Skip to content

Instantly share code, notes, and snippets.

@passcod
Last active August 29, 2015 13:57
Show Gist options
  • Save passcod/9754095 to your computer and use it in GitHub Desktop.
Save passcod/9754095 to your computer and use it in GitHub Desktop.
missing lifetime specifier error
mod treething {
use std::any::Any;
struct SizeTable(&[int]);
enum Content {
Data(&[&Any]),
Children(&[Node])
}
struct Node {
height: int,
content: Content,
sizetable: SizeTable
}
}
fn main() {
println("It runs!");
}
$ rustc atreething.rs | gist -p
atreething.rs:4:20: 4:26 error: missing lifetime specifier
atreething.rs:4 struct SizeTable(&[int]);
^~~~~~
atreething.rs:7:10: 7:17 error: missing lifetime specifier
atreething.rs:7 Data(&[&Any]),
^~~~~~~
atreething.rs:7:12: 7:16 error: missing lifetime specifier
atreething.rs:7 Data(&[&Any]),
^~~~
atreething.rs:8:14: 8:21 error: missing lifetime specifier
atreething.rs:8 Children(&[Node])
^~~~~~~
error: aborting due to 4 previous errors
task 'rustc' failed at 'explicit failure', /build/rust/src/rust-0.9/src/libsyntax/diagnostic.rs:75
task '<main>' failed at 'explicit failure', /build/rust/src/rust-0.9/src/librustc/lib.rs:453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment