mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
20 lines
344 B
Rust
20 lines
344 B
Rust
// Test that lifetimes must be declared for use on enums.
|
|
// See also regions-undeclared.rs
|
|
|
|
enum Yes0<'lt> {
|
|
X3(&'lt usize)
|
|
}
|
|
|
|
enum Yes1<'a> {
|
|
X4(&'a usize)
|
|
}
|
|
|
|
enum No0 {
|
|
X5(&'foo usize) //~ ERROR use of undeclared lifetime name `'foo`
|
|
}
|
|
|
|
enum No1 {
|
|
X6(&'a usize) //~ ERROR use of undeclared lifetime name `'a`
|
|
}
|
|
|
|
fn main() {}
|