diff options
| author | kennytm <kennytm@gmail.com> | 2017-10-28 15:56:24 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-28 15:56:24 +0800 |
| commit | 65f1df594a35ed894ea32a3a6e5b92e91ce84c99 (patch) | |
| tree | 9f3de838fafe0ca85ccc2aba632e47404b241329 | |
| parent | 55c4849ca4fee1a7d891cd58d86e037043294b41 (diff) | |
| parent | 880200ac6b3dd939e2385264441d063a8f38312a (diff) | |
| download | rust-65f1df594a35ed894ea32a3a6e5b92e91ce84c99.tar.gz rust-65f1df594a35ed894ea32a3a6e5b92e91ce84c99.zip | |
Rollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnik
Fixed rustc_on_unimplemented example in Unstable Book I saw [this](https://doc.rust-lang.org/beta/unstable-book/language-features/on-unimplemented.html) example and it seemed wrong. This fixes the example to emit an error message that makes more sense.
| -rw-r--r-- | src/doc/unstable-book/src/language-features/on-unimplemented.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/unstable-book/src/language-features/on-unimplemented.md b/src/doc/unstable-book/src/language-features/on-unimplemented.md index 9eea3fccbbc..70c7c110b78 100644 --- a/src/doc/unstable-book/src/language-features/on-unimplemented.md +++ b/src/doc/unstable-book/src/language-features/on-unimplemented.md @@ -15,8 +15,8 @@ For example: ```rust,compile_fail #![feature(on_unimplemented)] -#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an \ - iterator over elements of type `{A}`"] +#[rustc_on_unimplemented="an iterator over elements of type `{A}` \ + cannot be built from a collection of type `{Self}`"] trait MyIterator<A> { fn next(&mut self) -> A; } @@ -37,9 +37,9 @@ error[E0277]: the trait bound `&[{integer}]: MyIterator<char>` is not satisfied --> <anon>:14:5 | 14 | iterate_chars(&[1, 2, 3][..]); - | ^^^^^^^^^^^^^ the trait `MyIterator<char>` is not implemented for `&[{integer}]` + | ^^^^^^^^^^^^^ an iterator over elements of type `char` cannot be built from a collection of type `&[{integer}]` | - = note: a collection of type `&[{integer}]` cannot be built from an iterator over elements of type `char` + = help: the trait `MyIterator<char>` is not implemented for `&[{integer}]` = note: required by `iterate_chars` error: aborting due to previous error |
