mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-30 08:16:56 +00:00

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.
18 lines
443 B
Rust
18 lines
443 B
Rust
//@ check-pass
|
|
|
|
// https://github.com/rust-lang/rust/pull/60944#issuecomment-495346120
|
|
|
|
struct Foo<'a>(&'a ());
|
|
impl<'a> Foo<'a> {
|
|
fn foo<'b>(self: &'b Foo<'a>) -> &() { self.0 }
|
|
//~^ WARNING eliding a lifetime that's named elsewhere is confusing
|
|
}
|
|
|
|
type Alias = Foo<'static>;
|
|
impl Alias {
|
|
fn bar<'a>(self: &Alias, arg: &'a ()) -> &() { arg }
|
|
//~^ WARNING eliding a lifetime that's named elsewhere is confusing
|
|
}
|
|
|
|
fn main() {}
|