]> git.lizzy.rs Git - rust.git/blob - tests/ui/trait-bounds/impl-derived-implicit-sized-bound.stderr
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / ui / trait-bounds / impl-derived-implicit-sized-bound.stderr
1 error[E0599]: the method `get` exists for struct `Victim<'_, Self>`, but its trait bounds were not satisfied
2   --> $DIR/impl-derived-implicit-sized-bound.rs:31:19
3    |
4 LL | struct Victim<'a, T: Perpetrator + ?Sized>
5    | ------------------------------------------
6    | |
7    | method `get` not found for this struct
8    | doesn't satisfy `Victim<'_, Self>: VictimTrait`
9 ...
10 LL |     self.getter().get();
11    |                   ^^^ method cannot be called on `Victim<'_, Self>` due to unsatisfied trait bounds
12    |
13 note: trait bound `Self: Sized` was not satisfied
14   --> $DIR/impl-derived-implicit-sized-bound.rs:15:10
15    |
16 LL | impl<'a, T: Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
17    |          ^                            -----------     -------------
18    |          |
19    |          unsatisfied trait bound introduced here
20 help: consider relaxing the type parameter's implicit `Sized` bound
21    |
22 LL | impl<'a, T: ?Sized + Perpetrator /*+ ?Sized*/> VictimTrait for Victim<'a, T> {
23    |             ++++++++
24 help: consider restricting the type parameter to satisfy the trait bound
25    |
26 LL |   Self: Sized, Self: Sized
27    |              +++++++++++++
28
29 error: aborting due to previous error
30
31 For more information about this error, try `rustc --explain E0599`.