]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-impls-copy.stderr
Rollup merge of #85766 - workingjubilee:file-options, r=yaahc
[rust.git] / src / test / ui / coherence / coherence-impls-copy.stderr
1 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
2   --> $DIR/coherence-impls-copy.rs:5:1
3    |
4 LL | impl Copy for i32 {}
5    | ^^^^^^^^^^^^^^---
6    | |             |
7    | |             `i32` is not defined in the current crate
8    | impl doesn't use only types from inside the current crate
9    |
10    = note: define and implement a trait or new type instead
11
12 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
13   --> $DIR/coherence-impls-copy.rs:25:1
14    |
15 LL | impl Copy for (MyType, MyType) {}
16    | ^^^^^^^^^^^^^^----------------
17    | |             |
18    | |             this is not defined in the current crate because tuples are always foreign
19    | impl doesn't use only types from inside the current crate
20    |
21    = note: define and implement a trait or new type instead
22
23 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
24   --> $DIR/coherence-impls-copy.rs:30:1
25    |
26 LL | impl Copy for [MyType] {}
27    | ^^^^^^^^^^^^^^--------
28    | |             |
29    | |             this is not defined in the current crate because slices are always foreign
30    | impl doesn't use only types from inside the current crate
31    |
32    = note: define and implement a trait or new type instead
33
34 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
35   --> $DIR/coherence-impls-copy.rs:33:1
36    |
37 LL | impl Copy for &'static [NotSync] {}
38    | ^^^^^^^^^^^^^^------------------
39    | |             |
40    | |             this is not defined in the current crate because slices are always foreign
41    | impl doesn't use only types from inside the current crate
42    |
43    = note: define and implement a trait or new type instead
44
45 error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`
46   --> $DIR/coherence-impls-copy.rs:28:1
47    |
48 LL | impl Copy for &'static NotSync {}
49    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50    |
51    = note: conflicting implementation in crate `core`:
52            - impl<T> Copy for &T
53              where T: ?Sized;
54
55 error[E0206]: the trait `Copy` may not be implemented for this type
56   --> $DIR/coherence-impls-copy.rs:21:15
57    |
58 LL | impl Copy for &'static mut MyType {}
59    |               ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration
60
61 error[E0206]: the trait `Copy` may not be implemented for this type
62   --> $DIR/coherence-impls-copy.rs:25:15
63    |
64 LL | impl Copy for (MyType, MyType) {}
65    |               ^^^^^^^^^^^^^^^^ type is not a structure or enumeration
66
67 error[E0206]: the trait `Copy` may not be implemented for this type
68   --> $DIR/coherence-impls-copy.rs:30:15
69    |
70 LL | impl Copy for [MyType] {}
71    |               ^^^^^^^^ type is not a structure or enumeration
72
73 error: aborting due to 8 previous errors
74
75 Some errors have detailed explanations: E0117, E0119, E0206.
76 For more information about an error, try `rustc --explain E0117`.