fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.9 KiB43 linesraw
1error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
2  --> $DIR/coherence-impls-send.rs:20:1
3   |
4LL | unsafe impl Send for (MyType, MyType) {}
5   | ^^^^^^^^^^^^^^^^^^^^^----------------
6   | |                    |
7   | |                    this is not defined in the current crate because tuples are always foreign
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[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
13  --> $DIR/coherence-impls-send.rs:24:1
14   |
15LL | unsafe impl Send for &'static NotSync {}
16   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
17
18error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
19  --> $DIR/coherence-impls-send.rs:28:1
20   |
21LL | unsafe impl Send for [MyType] {}
22   | ^^^^^^^^^^^^^^^^^^^^^--------
23   | |                    |
24   | |                    this is not defined in the current crate because slices are always foreign
25   | impl doesn't use only types from inside the current crate
26   |
27   = note: define and implement a trait or new type instead
28
29error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
30  --> $DIR/coherence-impls-send.rs:32:1
31   |
32LL | unsafe impl Send for &'static [NotSync] {}
33   | ^^^^^^^^^^^^^^^^^^^^^------------------
34   | |                    |
35   | |                    this is not defined in the current crate because slices are always foreign
36   | impl doesn't use only types from inside the current crate
37   |
38   = note: define and implement a trait or new type instead
39
40error: aborting due to 4 previous errors
41
42Some errors have detailed explanations: E0117, E0321.
43For more information about an error, try `rustc --explain E0117`.