Files
rust/tests/ui/lifetimes/mismatched-lifetime-syntaxes-details/static.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

65 lines
2.3 KiB
Plaintext

error: eliding a lifetime that's named elsewhere is confusing
--> $DIR/static.rs:16:18
|
LL | fn ampersand(x: &'static u8) -> &u8 {
| ^^^^^^^ --- 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: the lint level is defined here
--> $DIR/static.rs:1:9
|
LL | #![deny(mismatched_lifetime_syntaxes)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consistently use `'static`
|
LL | fn ampersand(x: &'static u8) -> &'static u8 {
| +++++++
error: hiding a lifetime that's named elsewhere is confusing
--> $DIR/static.rs:23:17
|
LL | fn brackets(x: &'static u8) -> Brackets {
| ^^^^^^^ -------- the same lifetime is hidden here
| |
| the lifetime is named here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: consistently use `'static`
|
LL | fn brackets(x: &'static u8) -> Brackets<'static> {
| +++++++++
error: hiding a lifetime that's named elsewhere is confusing
--> $DIR/static.rs:30:14
|
LL | fn comma(x: &'static u8) -> Comma<u8> {
| ^^^^^^^ --------- the same lifetime is hidden here
| |
| the lifetime is named here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: consistently use `'static`
|
LL | fn comma(x: &'static u8) -> Comma<'static, u8> {
| ++++++++
error: eliding a lifetime that's named elsewhere is confusing
--> $DIR/static.rs:35:19
|
LL | fn underscore(x: &'static u8) -> &'_ u8 {
| ^^^^^^^ -- 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 `'static`
|
LL - fn underscore(x: &'static u8) -> &'_ u8 {
LL + fn underscore(x: &'static u8) -> &'static u8 {
|
error: aborting due to 4 previous errors