rust/src/test/run-pass/issue-3447.rs
Tim Chevalier b38092e9a2 In ty::normalize_ty, don't replace self_regions with None
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
2012-10-15 17:46:09 -07:00

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);
}