]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-impls-send.stderr
Stabilize File::options()
[rust.git] / src / test / ui / coherence / coherence-impls-send.stderr
1 error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]`
2   --> $DIR/coherence-impls-send.rs:25:1
3    |
4 LL | unsafe impl Send for &'static [NotSync] {}
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: conflicting implementation in crate `core`:
8            - impl<T> Send for &T
9              where T: Sync, T: ?Sized;
10    = note: upstream crates may add a new impl of trait `std::marker::Sync` for type `[NotSync]` in future versions
11
12 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
13   --> $DIR/coherence-impls-send.rs:16:1
14    |
15 LL | unsafe impl Send 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[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
24   --> $DIR/coherence-impls-send.rs:19:1
25    |
26 LL | unsafe impl Send for &'static NotSync {}
27    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type
28
29 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
30   --> $DIR/coherence-impls-send.rs:22:1
31    |
32 LL | unsafe impl Send for [MyType] {}
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
40 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
41   --> $DIR/coherence-impls-send.rs:25:1
42    |
43 LL | unsafe impl Send for &'static [NotSync] {}
44    | ^^^^^^^^^^^^^^^^^^^^^------------------
45    | |                    |
46    | |                    this is not defined in the current crate because slices are always foreign
47    | impl doesn't use only types from inside the current crate
48    |
49    = note: define and implement a trait or new type instead
50
51 error: aborting due to 5 previous errors
52
53 Some errors have detailed explanations: E0117, E0119, E0321.
54 For more information about an error, try `rustc --explain E0117`.