Commit graph

111 commits

Author SHA1 Message Date
Ilija Tovilo
3a6a29b4ec
Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
Bruce Mitchener
86633b6389 Fix typos in doc comments. 2019-08-02 01:36:36 +07:00
lzutao
6471bd5f19
Add missing link to Infallible in TryFrom doc 2019-07-17 10:44:12 +07:00
Mark Rousskov
37c58c63a7
Rollup merge of #62186 - GuillaumeGomez:add-missing-type-links-into, r=docs
Add missing type urls in Into trait

r? @rust-lang/docs
2019-07-03 09:59:18 -04:00
Guillaume Gomez
3e83728ddd Add missing type urls in Into trait 2019-06-29 22:28:25 +02:00
Guillaume Gomez
dfb9f5be30 Add missing links for TryFrom docs 2019-06-29 22:24:54 +02:00
Gurwinder Singh
34188fb636 Fix Into trait links 2019-06-20 15:02:27 +05:30
Fabian Drinck
9583398923 Fix typo in AsRef doc 2019-06-02 14:12:06 +02:00
OptimisticPeach
fc21f33d4d
Fixed some typos. 2019-05-30 19:37:23 -04:00
Mazdak Farrokhzad
250fe9b37e
Rollup merge of #59923 - czipperz:fix-convert-doc-links, r=steveklabnik
Fix convert module's documentation links

r? @steveklabnik
2019-05-16 10:43:28 +02:00
Taiki Endo
360432f1e8 libcore => 2018 2019-04-18 14:47:35 +09:00
Chris Gregory
1f5d510604 Fix stray ` in previous change 2019-04-13 21:23:31 -05:00
Chris Gregory
1e48da6c81 Escape &str in convert docs 2019-04-13 18:14:44 -05:00
Chris Gregory
27ff5360ab Reorder blank lines in AsMut documentation 2019-04-13 15:25:13 -05:00
Chris Gregory
4a33ece382 Remove blank lines in AsRef documentation 2019-04-13 11:57:02 -05:00
Chris Gregory
b701d32ca8 Remove broken links to self in Into documentation 2019-04-13 10:38:06 -05:00
Chris Gregory
6bf94cd3ff Remove dangling ` in Into documentation 2019-04-13 10:34:52 -05:00
Chris Gregory
eba03d462e Fix convert module's documentation links 2019-04-12 01:23:23 -05:00
Mazdak Farrokhzad
c065367ca0
Rollup merge of #59707 - GuillaumeGomez:GuillaumeGomez-patch-1, r=Centril
Add missing tryfrom example

r? @rust-lang/docs
2019-04-06 00:14:46 +02:00
Guillaume Gomez
c386210714 Add missing tryfrom example 2019-04-05 17:38:25 +02:00
Aleksey Kladov
1cfed0d452 be more direct about borrow requirenments 2019-04-03 11:41:24 +03:00
Josh Stone
e5fa59735b
Rollup merge of #59268 - estebank:from-string, r=QuietMisdreavus
Add suggestion to use `&*var` when `&str: From<String>` is expected

Fix #53879.
2019-03-27 18:15:24 -07:00
Christian
6c479c3d02 Formatting changes, including better wrapping and creating short summary lines. 2019-03-25 22:21:05 +01:00
Esteban Küber
e929d19edc review comments 2019-03-22 21:54:19 -07:00
Esteban Küber
ac3290e8d9 Add suggestion to use &*var when &str: From<String> is expected 2019-03-22 20:38:14 -07:00
Christian
70ce4b168d Wrapped a line such that it does not exceed 100 characters. 2019-03-21 19:36:51 +01:00
Christian
d7fcd219c5 Changed inline code by using a single quote. 2019-03-21 18:49:12 +01:00
Christian
a66fca459a Added back a reference to "the book" 2019-03-21 18:42:15 +01:00
Christian
d657d18083 Fixed indentation of list items. 2019-03-21 15:26:07 +01:00
Christian
49a9b349ac Reformatted the text such that the line length does not exceed 100. 2019-03-21 15:06:16 +01:00
Christian
71bdeb022a Initial version of the documentation change of std::convert. 2019-03-20 23:15:41 +01:00
Simon Sapin
db99a3bccd Remove stabilized feature gate in doctest 2019-03-12 17:42:42 +01:00
Simon Heath
60cf413a20 Incorporated review changes. 2019-02-27 16:03:11 +01:00
Simon Heath
72afe51d81 Slowly figuring out how rustdoc actually works.
Unfortunately trying to run doctests on my local machine is
not really faster than letting Travis do it...
2019-02-27 16:03:11 +01:00
Simon Heath
cc6f394d6f Fix some links in TryFrom docs. 2019-02-27 16:03:11 +01:00
Simon Heath
c1d1c6731c Fix a bunch of heckin' trailing whitespace 2019-02-27 16:02:25 +01:00
Simon Heath
d2b1212558 Started expanding docs for TryFrom and TryInto.
The examples are still lacking for now, both for module docs
and for methods/impl's.
2019-02-27 16:02:25 +01:00
bors
00aae71f50 Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichton
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-25 20:24:10 +00:00
Simon Sapin
cf267540eb Review comments 2019-02-17 21:30:38 +01:00
Mazdak Farrokhzad
aa896f30bb
Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnik
Convert old first edition links to current edition one

r? @steveklabnik
2019-02-14 02:41:16 +01:00
Simon Sapin
b2cf9a02b2 Add impl From<!> for Infallible
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-13 19:29:07 +01:00
Simon Sapin
c80a8f51dc Stabilize TryFrom and TryInto 2019-02-13 18:00:18 +01:00
Simon Sapin
2f7120397f Use convert::Infallible instead of never in the blanket TryFrom impl 2019-02-13 18:00:18 +01:00
Simon Sapin
85f13f0d42 Add a convert::Infallible empty enum, make string::ParseError an alias 2019-02-13 18:00:18 +01:00
Lzu Tao
e7f8e63ed4 Convert old doc links to current edition
Use footnote style to bypass the tidy check
2019-02-13 14:39:25 +00:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
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-12 19:09:24 +00:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Simon Heath
b4d3c87ebc Tiny improvement to docs for core::convert.
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-26 16:46:15 -05:00
Mazdak Farrokhzad
ebc70e2e9e
Rollup merge of #56796 - KrishnaSannasi:try_from_impl_change, r=shepmaster
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-21 02:21:53 +01:00
Mazdak Farrokhzad
e75dab7f67 stabilize convert::identity 2019-01-04 01:42:31 +01:00