fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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