rust/tests/ui/underscore-lifetime/in-struct.rs

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

14 lines
240 B
Rust
Raw Normal View History

// Check that the `'_` used in structs/enums gives an error.
use std::fmt::Debug;
struct Foo {
2018-10-19 15:43:46 -05:00
x: &'_ u32, //~ ERROR missing lifetime specifier
}
2018-10-19 15:39:41 -05:00
enum Bar {
2018-10-19 15:43:46 -05:00
Variant(&'_ u32), //~ ERROR missing lifetime specifier
}
fn main() { }