1 // Copyright 2015 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 #![feature(optin_builtin_traits)]
13 use std
::marker
::Copy
;
22 impl !Sync
for NotSync {}
24 impl Copy
for TestE {}
25 impl Clone
for TestE { fn clone(&self) -> Self { *self }
}
27 impl Copy
for MyType {}
29 impl Copy
for &'
static mut MyType {}
30 //~^ ERROR the trait `Copy` may not be implemented for this type
31 //~| NOTE type is not a structure or enumeration
32 impl Clone
for MyType { fn clone(&self) -> Self { *self }
}
34 impl Copy
for (MyType
, MyType
) {}
35 //~^ ERROR the trait `Copy` may not be implemented for this type
36 //~| NOTE type is not a structure or enumeration
37 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
38 //~| NOTE impl doesn't use types inside crate
39 //~| NOTE the impl does not reference any types defined in this crate
41 impl Copy
for &'
static NotSync {}
42 //~^ ERROR the trait `Copy` may not be implemented for this type
43 //~| NOTE type is not a structure or enumeration
45 impl Copy
for [MyType
] {}
46 //~^ ERROR the trait `Copy` may not be implemented for this type
47 //~| NOTE type is not a structure or enumeration
48 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
49 //~| NOTE impl doesn't use types inside crate
50 //~| NOTE the impl does not reference any types defined in this crate
52 impl Copy
for &'
static [NotSync
] {}
53 //~^ ERROR the trait `Copy` may not be implemented for this type
54 //~| NOTE type is not a structure or enumeration
55 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
56 //~| NOTE impl doesn't use types inside crate
57 //~| NOTE the impl does not reference any types defined in this crate