1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![crate_type = "lib"]
13 #![feature(box_syntax)]
15 static mut COUNT: u64 = 1;
17 pub fn get_count() -> u64 { unsafe { COUNT } }
19 #[derive(Copy, Clone)]
23 pub fn run_trait(self) {
24 unsafe { COUNT *= 17; }
25 // Test internal call.
36 pub trait Bar : Sized {
39 fn foo3(self: Box<Self>);
42 unsafe { COUNT *= 7; }
45 unsafe { COUNT *= 11; }
47 fn bar3(self: Box<Self>) {
48 unsafe { COUNT *= 13; }
54 unsafe { COUNT *= 2; }
58 unsafe { COUNT *= 3; }
61 fn foo3(self: Box<Foo>) {
62 unsafe { COUNT *= 5; }