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