2 // Test method calls with self as an argument
4 static mut COUNT: usize = 1;
10 fn foo(self, x: &Foo) {
11 unsafe { COUNT *= 2; }
12 // Test internal call.
19 Foo::qux(Box::new(self));
20 Foo::qux(Box::new(*x));
24 unsafe { COUNT *= 3; }
28 unsafe { COUNT *= 5; }
31 fn qux(self: Box<Foo>) {
32 unsafe { COUNT *= 7; }
38 // Test external call.
41 Foo::qux(Box::new(x));
45 unsafe { assert_eq!(COUNT, 2*3*3*3*5*5*5*7*7*7); }