]> git.proxmox.com Git - rustc.git/blame - src/test/ui/single-use-lifetime/one-use-in-struct.rs
New upstream version 1.36.0+dfsg1
[rustc.git] / src / test / ui / single-use-lifetime / one-use-in-struct.rs
CommitLineData
94b46f34
XL
1// Test that we do not warn for named lifetimes in structs,
2// even when they are only used once (since to not use a named
3// lifetime is illegal!)
4//
5// compile-pass
6
7#![deny(single_use_lifetimes)]
8#![allow(dead_code)]
9#![allow(unused_variables)]
223e47cc 10
94b46f34
XL
11struct Foo<'f> {
12 data: &'f u32
13}
9e0c209e 14
94b46f34
XL
15enum Bar<'f> {
16 Data(&'f u32)
223e47cc 17}
94b46f34
XL
18
19trait Baz<'f> { }
20
21fn main() { }