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 20:43:46 +00:00
x: &'_ u32, //~ ERROR missing lifetime specifier
}
2018-10-19 20:39:41 +00:00
enum Bar {
2018-10-19 20:43:46 +00:00
Variant(&'_ u32), //~ ERROR missing lifetime specifier
}
fn main() { }