about summary refs log tree commit diff
path: root/src/libcore/convert.rs
AgeCommit message (Collapse)AuthorLines
2019-04-03be more direct about borrow requirenmentsAleksey Kladov-4/+6
2019-03-27Rollup merge of #59268 - estebank:from-string, r=QuietMisdreavusJosh Stone-0/+6
Add suggestion to use `&*var` when `&str: From<String>` is expected Fix #53879.
2019-03-25Formatting changes, including better wrapping and creating short summary lines.Christian-16/+21
2019-03-22review commentsEsteban Küber-1/+1
2019-03-22Add suggestion to use `&*var` when `&str: From<String>` is expectedEsteban Küber-0/+6
2019-03-21Wrapped a line such that it does not exceed 100 characters.Christian-1/+2
2019-03-21Changed inline code by using a single quote.Christian-20/+20
2019-03-21Added back a reference to "the book"Christian-2/+2
2019-03-21Fixed indentation of list items.Christian-4/+2
2019-03-21Reformatted the text such that the line length does not exceed 100.Christian-15/+22
2019-03-20Initial version of the documentation change of std::convert.Christian-85/+85
2019-03-12Remove stabilized feature gate in doctestSimon Sapin-1/+0
2019-02-27Incorporated review changes.Simon Heath-1/+3
2019-02-27Slowly figuring out how rustdoc actually works.Simon Heath-0/+3
Unfortunately trying to run doctests on my local machine is not really faster than letting Travis do it...
2019-02-27Fix some links in TryFrom docs.Simon Heath-7/+15
2019-02-27Fix a bunch of heckin' trailing whitespaceSimon Heath-12/+12
2019-02-27Started expanding docs for `TryFrom` and `TryInto`.Simon Heath-1/+43
The examples are still lacking for now, both for module docs and for methods/impl's.
2019-02-25Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichtonbors-5/+123
Stabilize TryFrom and TryInto with a convert::Infallible empty enum This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898
2019-02-17Review commentsSimon Sapin-2/+16
2019-02-14Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnikMazdak Farrokhzad-4/+1
Convert old first edition links to current edition one r? @steveklabnik
2019-02-13Add `impl From<!> for Infallible`Simon Sapin-0/+7
The reverse conversion unfortunately causes unexpected errors like: ``` error[E0277]: the trait bound `!: std::convert::From<()>` is not satisfied --> src/librustc_metadata/encoder.rs:105:9 | 105 | self.emit_usize(seq.len)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<()>` is not implemented for `!` | = help: the following implementations were found: <! as std::convert::From<std::convert::Infallible>> = note: the trait is implemented for `()`. Possibly this error has been caused by changes to Rust's type-inference algorithm (see: https://github.com/rust-lang/rust/issues/48950 for more info). Consider whether you meant to use the type `()` here instead. = note: required by `std::convert::From::from` ``` I don’t understand why this error happens. If I’m reading the code correctly the return types of `emit_usize` and of the method that contains line 105 are both `Result<(), !>`, so the expansion of the `?` operator should involve `!: From<!>`, not `From<()>`. Is this a type inference bug?
2019-02-13Stabilize TryFrom and TryIntoSimon Sapin-4/+8
2019-02-13Use convert::Infallible instead of never in the blanket TryFrom implSimon Sapin-1/+1
2019-02-13Add a convert::Infallible empty enum, make string::ParseError an aliasSimon Sapin-0/+93
2019-02-13Convert old doc links to current editionLzu Tao-4/+1
Use footnote style to bypass the tidy check
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-1/+1
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-10tests: doc commentsAlexander Regueiro-1/+1
2019-01-26Tiny improvement to docs for `core::convert`.Simon Heath-1/+4
This is not really significant, accept or reject as you wish. I just want to make sure I understand how the PR process works and I'm doing it right before doing a bigger one for #33417.
2019-01-21Rollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmasterMazdak Farrokhzad-2/+2
Change bounds on `TryFrom` blanket impl to use `Into` instead of `From` This is from this [comment](https://github.com/rust-lang/rust/issues/33417#issuecomment-447111156) I made. This will expand the impls available for `TryFrom` and `TryInto`, without losing anything in the process.
2019-01-04stabilize convert::identityMazdak Farrokhzad-4/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-13Change bounds on `TryFrom` blanket impl to use `Into` instead of `From`Ozaren-2/+2
2018-12-07use top level `fs` functions where appropriateAndy Russell-4/+3
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-11-10constify parts of libcore.Mazdak Farrokhzad-1/+0
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-3/+3
2018-08-20core::convert::identity: fix issue number to #53500Mazdak Farrokhzad-1/+1
2018-08-19Make core::convert::identity a const fn.Mazdak Farrokhzad-1/+2
2018-08-19Merge branch 'master' into feature/core_convert_idMazdak Farrokhzad-51/+22
2018-07-15AsRef doc wording tweaksCameron McCormack-3/+3
2018-04-20Revert "Stabilize the TryFrom and TryInto traits"Felix S. Klock II-8/+4
This reverts commit e53a2a72743810e05f58c61c9d8a4c89b712ad2e.
2018-03-26Stabilize the TryFrom and TryInto traitsSimon Sapin-4/+8
Tracking issue: https://github.com/rust-lang/rust/issues/33417
2018-03-22Rollup merge of #49038 - canndrew:replace-infallible-with-never, r=SimonSapinkennytm-20/+1
replace `convert::Infallible` with `!`
2018-03-17update FIXME(#23442) to point to issue 45742 (Blanket impl of AsRef for Deref)Niv Kaminer-2/+2
2018-03-15replace `convert::Infallible` with `!`Andrew Cann-20/+1
2018-02-04Fix info about generic impls in AsMut docsMatt Brubeck-3/+3
This text was copy-pasted from the `AsRef` docs to `AsMut`, but needed some additional adjustments for correctness.
2018-01-19fix doctests for convert::idMazdak-2/+4
2018-01-19add fn core::convert::id<T>(x: T) -> T { x }Mazdak-0/+67
2017-09-23Simplify implementation of Display and Error for convert::Infallible.Jimmy Cuadra-2/+3
2017-09-21Impl fmt::Display for convert::Infallible.Jimmy Cuadra-0/+8
2017-09-18Derive additional traits for Infallible.Jimmy Cuadra-9/+1