Skip to content

Commit 880200a

Browse files
committed
Fixed rustc_on_unimplemented example in Unstable Book
1 parent 1855aff commit 880200a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/doc/unstable-book/src/language-features/on-unimplemented.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ For example:
1515
```rust,compile_fail
1616
#![feature(on_unimplemented)]
1717
18-
#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an \
19-
iterator over elements of type `{A}`"]
18+
#[rustc_on_unimplemented="an iterator over elements of type `{A}` \
19+
cannot be built from a collection of type `{Self}`"]
2020
trait MyIterator<A> {
2121
fn next(&mut self) -> A;
2222
}
@@ -37,9 +37,9 @@ error[E0277]: the trait bound `&[{integer}]: MyIterator<char>` is not satisfied
3737
--> <anon>:14:5
3838
|
3939
14 | iterate_chars(&[1, 2, 3][..]);
40-
| ^^^^^^^^^^^^^ the trait `MyIterator<char>` is not implemented for `&[{integer}]`
40+
| ^^^^^^^^^^^^^ an iterator over elements of type `char` cannot be built from a collection of type `&[{integer}]`
4141
|
42-
= note: a collection of type `&[{integer}]` cannot be built from an iterator over elements of type `char`
42+
= help: the trait `MyIterator<char>` is not implemented for `&[{integer}]`
4343
= note: required by `iterate_chars`
4444
4545
error: aborting due to previous error

0 commit comments

Comments
 (0)