]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_trait.rs
Update ui tests
[rust.git] / src / test / ui / self / arbitrary_self_types_trait.rs
1 // run-pass
2 #![feature(arbitrary_self_types)]
3
4 use std::rc::Rc;
5
6 trait Trait {
7     fn trait_method<'a>(self: &'a Box<Rc<Self>>) -> &'a [i32];
8 }
9
10 impl Trait for Vec<i32> {
11     fn trait_method<'a>(self: &'a Box<Rc<Self>>) -> &'a [i32] {
12         &***self
13     }
14 }
15
16 fn main() {
17     let v = vec![1,2,3];
18
19     assert_eq!(&[1,2,3], Box::new(Rc::new(v)).trait_method());
20 }