]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/uniq-self-in-mut-slot.rs
Update ui tests
[rust.git] / src / test / ui / self / uniq-self-in-mut-slot.rs
1 // run-pass
2 #![feature(box_syntax)]
3
4 struct X {
5     a: isize
6 }
7
8 trait Changer {
9     fn change(self: Box<Self>) -> Box<Self>;
10 }
11
12 impl Changer for X {
13     fn change(mut self: Box<X>) -> Box<X> {
14         self.a = 55;
15         self
16     }
17 }
18
19 pub fn main() {
20     let x: Box<_> = box X { a: 32 };
21     let new_x = x.change();
22     assert_eq!(new_x.a, 55);
23 }