168e35d569
In most places, we use a span when emitting `expected...found` errors. However, there were a couple of places where we didn't use any span, resulting in hard-to-interpret error messages. This commit attaches the relevant span to these notes, and additionally switches over to using `note_expected_found` instead of manually formatting the message
35 lines
985 B
Plaintext
35 lines
985 B
Plaintext
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
|
|
--> $DIR/issue-16683.rs:4:14
|
|
|
|
|
LL | self.a();
|
|
| ^
|
|
|
|
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 3:5...
|
|
--> $DIR/issue-16683.rs:3:5
|
|
|
|
|
LL | / fn b(&self) {
|
|
LL | | self.a();
|
|
LL | | }
|
|
| |_____^
|
|
note: ...so that reference does not outlive borrowed content
|
|
--> $DIR/issue-16683.rs:4:9
|
|
|
|
|
LL | self.a();
|
|
| ^^^^
|
|
note: but, the lifetime must be valid for the lifetime `'a` as defined on the trait at 1:9...
|
|
--> $DIR/issue-16683.rs:1:9
|
|
|
|
|
LL | trait T<'a> {
|
|
| ^^
|
|
note: ...so that the types are compatible
|
|
--> $DIR/issue-16683.rs:4:14
|
|
|
|
|
LL | self.a();
|
|
| ^
|
|
= note: expected `&'a Self`
|
|
found `&Self`
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0495`.
|