rust/tests/ui/delegation/ice-issue-122550.stderr
Esteban Küber 049c32797b On E0277, point at type that doesn't implement bound
When encountering an unmet trait bound, point at local type that doesn't implement the trait:

```
error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied
  --> $DIR/issue-64855.rs:9:19
   |
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
   |                   ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the trait `Foo` is not implemented for `Bar<T>`
  --> $DIR/issue-64855.rs:9:1
   |
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
   | ^^^^^^^^^^^^^^^^^
```
2025-08-22 17:55:15 +00:00

44 lines
1.3 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/ice-issue-122550.rs:5:35
|
LL | fn description(&self) -> &str {}
| ^^ expected `&str`, found `()`
error[E0277]: the trait bound `S: Trait` is not satisfied
--> $DIR/ice-issue-122550.rs:13:12
|
LL | reuse <S as Trait>::description { &self.0 }
| ^ unsatisfied trait bound
|
help: the trait `Trait` is not implemented for `S`
--> $DIR/ice-issue-122550.rs:10:1
|
LL | struct S(F);
| ^^^^^^^^
help: this trait has no implementations, consider adding one
--> $DIR/ice-issue-122550.rs:4:1
|
LL | trait Trait {
| ^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/ice-issue-122550.rs:13:39
|
LL | reuse <S as Trait>::description { &self.0 }
| ----------- ^^^^^^^ expected `&S`, found `&F`
| |
| arguments to this function are incorrect
|
= note: expected reference `&S`
found reference `&F`
note: method defined here
--> $DIR/ice-issue-122550.rs:5:8
|
LL | fn description(&self) -> &str {}
| ^^^^^^^^^^^ -----
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.