]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/in-trait/specialization-broken.stderr
Fix ICE in default impl error reporting
[rust.git] / src / test / ui / impl-trait / in-trait / specialization-broken.stderr
1 error[E0053]: method `bar` has an incompatible type for trait
2   --> $DIR/specialization-broken.rs:16:22
3    |
4 LL | default impl<U> Foo for U
5    |              - this type parameter
6 ...
7 LL |     fn bar(&self) -> U {
8    |                      ^
9    |                      |
10    |                      expected associated type, found type parameter `U`
11    |                      help: change the output type to match the trait: `impl Sized`
12    |
13 note: type in trait
14   --> $DIR/specialization-broken.rs:9:22
15    |
16 LL |     fn bar(&self) -> impl Sized;
17    |                      ^^^^^^^^^^
18    = note: expected fn pointer `fn(&U) -> impl Sized`
19               found fn pointer `fn(&U) -> U`
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0053`.