]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issue-55872-1.stderr
Check opaque types satisfy their bounds
[rust.git] / src / test / ui / impl-trait / issue-55872-1.stderr
1 error[E0276]: impl has stricter requirements than trait
2   --> $DIR/issue-55872-1.rs:15:5
3    |
4 LL |     fn foo<T>() -> Self::E;
5    |     ----------------------- definition of `foo` from trait
6 ...
7 LL |     fn foo<T: Default>() -> Self::E {
8    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
9
10 error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
11   --> $DIR/issue-55872-1.rs:11:14
12    |
13 LL |     type E = impl Copy;
14    |              ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
15    |
16    = note: required because it appears within the type `(S, T)`
17 help: consider further restricting this bound
18    |
19 LL | impl<S: Default + Copy> Bar for S {
20    |                 ^^^^^^
21
22 error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
23   --> $DIR/issue-55872-1.rs:11:14
24    |
25 LL |     type E = impl Copy;
26    |              ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
27    |
28    = note: required because it appears within the type `(S, T)`
29 help: consider further restricting this bound
30    |
31 LL |     fn foo<T: Default + Copy>() -> Self::E {
32    |                       ^^^^^^
33
34 error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
35   --> $DIR/issue-55872-1.rs:15:37
36    |
37 LL |       fn foo<T: Default>() -> Self::E {
38    |  _____________________________________^
39 LL | |
40 LL | |
41 LL | |         (S::default(), T::default())
42 LL | |     }
43    | |_____^
44
45 error: aborting due to 4 previous errors
46
47 Some errors have detailed explanations: E0276, E0277.
48 For more information about an error, try `rustc --explain E0276`.