2 // Test method calls with self as an argument
4 static mut COUNT: u64 = 1;
12 fn foo3(self: Box<Self>);
15 unsafe { COUNT *= 7; }
18 unsafe { COUNT *= 11; }
20 fn bar3(self: Box<Self>) {
21 unsafe { COUNT *= 13; }
27 unsafe { COUNT *= 2; }
31 unsafe { COUNT *= 3; }
34 fn foo3(self: Box<Foo>) {
35 unsafe { COUNT *= 5; }
41 unsafe { COUNT *= 17; }
42 // Test internal call.
45 Bar::foo3(Box::new(self));
49 Bar::bar3(Box::new(self));
55 // Test external call.
58 Bar::foo3(Box::new(x));
62 Bar::bar3(Box::new(x));
66 unsafe { assert_eq!(COUNT, 2*2*3*3*5*5*7*7*11*11*13*13*17); }