]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-62742.stderr
Be more careful about unresolved exprs in suggestion
[rust.git] / src / test / ui / impl-trait / issues / issue-62742.stderr
1 error[E0277]: the trait bound `RawImpl<_>: Raw<_>` is not satisfied
2   --> $DIR/issue-62742.rs:4:5
3    |
4 LL |     WrongImpl::foo(0i32);
5    |     ^^^^^^^^^ the trait `Raw<_>` is not implemented for `RawImpl<_>`
6    |
7    = help: the trait `Raw<[T]>` is implemented for `RawImpl<T>`
8 note: required by a bound in `SafeImpl`
9   --> $DIR/issue-62742.rs:26:35
10    |
11 LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
12    |                                   ^^^^^^ required by this bound in `SafeImpl`
13
14 error[E0599]: the function or associated item `foo` exists for struct `SafeImpl<(), RawImpl<()>>`, but its trait bounds were not satisfied
15   --> $DIR/issue-62742.rs:6:22
16    |
17 LL |     WrongImpl::<()>::foo(0i32);
18    |                      ^^^ function or associated item cannot be called on `SafeImpl<(), RawImpl<()>>` due to unsatisfied trait bounds
19 ...
20 LL | pub struct RawImpl<T>(PhantomData<T>);
21    | --------------------- doesn't satisfy `RawImpl<()>: Raw<()>`
22 ...
23 LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
24    | ----------------------------------------- function or associated item `foo` not found for this struct
25    |
26    = note: the following trait bounds were not satisfied:
27            `RawImpl<()>: Raw<()>`
28 note: the following trait must be implemented
29   --> $DIR/issue-62742.rs:12:1
30    |
31 LL | pub trait Raw<T: ?Sized> {
32    | ^^^^^^^^^^^^^^^^^^^^^^^^
33
34 error[E0277]: the trait bound `RawImpl<()>: Raw<()>` is not satisfied
35   --> $DIR/issue-62742.rs:6:5
36    |
37 LL |     WrongImpl::<()>::foo(0i32);
38    |     ^^^^^^^^^^^^^^^ the trait `Raw<()>` is not implemented for `RawImpl<()>`
39    |
40    = help: the trait `Raw<[T]>` is implemented for `RawImpl<T>`
41 note: required by a bound in `SafeImpl`
42   --> $DIR/issue-62742.rs:26:35
43    |
44 LL | pub struct SafeImpl<T: ?Sized, A: Raw<T>>(PhantomData<(A, T)>);
45    |                                   ^^^^^^ required by this bound in `SafeImpl`
46
47 error: aborting due to 3 previous errors
48
49 Some errors have detailed explanations: E0277, E0599.
50 For more information about an error, try `rustc --explain E0277`.