2013-10-29 06:14:59 -04:00
|
|
|
// Test that lifetimes must be declared for use on enums.
|
|
|
|
// See also regions-undeclared.rs
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
enum Yes0<'lt> {
|
2015-01-08 22:02:42 +11:00
|
|
|
X3(&'lt usize)
|
2012-04-18 21:26:25 -07:00
|
|
|
}
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
enum Yes1<'a> {
|
2015-01-08 22:02:42 +11:00
|
|
|
X4(&'a usize)
|
2012-04-18 21:26:25 -07:00
|
|
|
}
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
enum No0 {
|
2015-01-08 22:02:42 +11:00
|
|
|
X5(&'foo usize) //~ ERROR use of undeclared lifetime name `'foo`
|
2013-10-29 06:14:59 -04:00
|
|
|
}
|
|
|
|
|
2018-12-16 22:21:47 -05:00
|
|
|
enum No1 {
|
2015-01-08 22:02:42 +11:00
|
|
|
X6(&'a usize) //~ ERROR use of undeclared lifetime name `'a`
|
2012-04-18 21:26:25 -07:00
|
|
|
}
|
|
|
|
|
2013-02-14 11:47:00 -08:00
|
|
|
fn main() {}
|