Files
rust/tests/ui/self/elision/ignore-non-reference-lifetimes.stderr
Jake Goulding 5530744318 Reword mismatched-lifetime-syntaxes text based on feedback
Key changes include:

- Removal of the word "syntax" from the lint message. More accurately,
  it could have been something like "syntax group" or "syntax
  category", but avoiding it completely is easier.
- The primary lint message now reflects exactly which mismatch is
  occurring, instead of trying to be general. A new `help` line is
  general across the mismatch kinds.
- Suggestions have been reduced to be more minimal, no longer also
  changing non-idiomatic but unrelated aspects.
- Suggestion text no longer mentions changes when those changes don't
  occur in that specific suggestion.
2025-07-14 09:52:58 -04:00

32 lines
1.3 KiB
Plaintext

warning: eliding a lifetime that's named elsewhere is confusing
--> $DIR/ignore-non-reference-lifetimes.rs:6:30
|
LL | fn a<'a>(self: Self, a: &'a str) -> &str {
| ^^ ---- the same lifetime is elided here
| |
| the lifetime is named here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: consistently use `'a`
|
LL | fn a<'a>(self: Self, a: &'a str) -> &'a str {
| ++
warning: eliding a lifetime that's named elsewhere is confusing
--> $DIR/ignore-non-reference-lifetimes.rs:10:33
|
LL | fn b<'a>(self: Foo<'b>, a: &'a str) -> &str {
| ^^ ---- the same lifetime is elided here
| |
| the lifetime is named here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: consistently use `'a`
|
LL | fn b<'a>(self: Foo<'b>, a: &'a str) -> &'a str {
| ++
warning: 2 warnings emitted