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;
16 //~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `i32`:
17 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
26 impl !Sync for NotSync {}
28 impl Copy for TestE {}
29 impl Clone for TestE { fn clone(&self) -> Self { *self } }
31 impl Copy for MyType {}
33 impl Copy for &'static mut MyType {}
34 //~^ ERROR the trait `Copy` may not be implemented for this type
35 impl Clone for MyType { fn clone(&self) -> Self { *self } }
37 impl Copy for (MyType, MyType) {}
38 //~^ ERROR the trait `Copy` may not be implemented for this type
39 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
41 impl Copy for &'static NotSync {}
42 //~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
44 impl Copy for [MyType] {}
45 //~^ ERROR the trait `Copy` may not be implemented for this type
46 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
48 impl Copy for &'static [NotSync] {}
49 //~^ ERROR conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
50 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types