b38092e9a2
Instead, replace with re_static. This was causing ty::subst to fail when called from trans::type_of::type_of. Already discussed with nmatsakis and it's a small change, so no review. Closes #3447
25 lines
424 B
Rust
25 lines
424 B
Rust
struct list<T> {
|
|
element: &self/T,
|
|
mut next: Option<@list<T>>
|
|
}
|
|
|
|
impl<T> list<T>{
|
|
fn addEnd(&self, element: &self/T) {
|
|
let newList = list {
|
|
element: element,
|
|
next: option::None
|
|
};
|
|
|
|
self.next = Some(@(move newList));
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let s = @"str";
|
|
let ls = list {
|
|
element: &s,
|
|
next: option::None
|
|
};
|
|
io::println(*ls.element);
|
|
}
|