rust/tests/ui/lifetimes/shadow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
200 B
Rust
Raw Normal View History

2017-11-17 06:59:45 +00:00
struct Foo<T>(T);
2022-02-10 02:42:32 +00:00
impl<'s> Foo<&'s u8> {
2017-11-20 12:13:27 +00:00
fn bar<'s>(&self, x: &'s u8) {} //~ ERROR shadows a lifetime name
fn baz(x: for<'s> fn(&'s u32)) {} //~ ERROR shadows a lifetime name
2017-11-17 06:59:45 +00:00
}
fn main() {}