]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/explicit-self-objects-uniq.rs
Update ui tests
[rust.git] / src / test / ui / self / explicit-self-objects-uniq.rs
1 // run-pass
2 #![feature(box_syntax)]
3
4 trait Foo {
5     fn f(self: Box<Self>);
6 }
7
8 struct S {
9     x: isize
10 }
11
12 impl Foo for S {
13     fn f(self: Box<S>) {
14         assert_eq!(self.x, 3);
15     }
16 }
17
18 pub fn main() {
19     let x = box S { x: 3 };
20     let y = x as Box<dyn Foo>;
21     y.f();
22 }