]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr
Rollup merge of #95426 - b-naber:valtrees-slice, r=RalfJung,oli-obk
[rust.git] / src / test / ui / typeck / typeck-default-trait-impl-cross-crate-coherence.stderr
1 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
2   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:14:1
3    |
4 LL | impl DefaultedTrait for (A,) { }
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
12 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
13   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:17:1
14    |
15 LL | impl !DefaultedTrait for (B,) { }
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 `DefaultedTrait`, can only be implemented for a struct/enum type defined in the current crate
24   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:21:1
25    |
26 LL | impl DefaultedTrait for Box<C> { }
27    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait for type in another crate
28
29 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
30   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:22:1
31    |
32 LL | impl DefaultedTrait for lib::Something<C> { }
33    | ^^^^^^^^^^^^^^^^^^^^^^^^-----------------
34    | |                       |
35    | |                       `Something` is not defined in the current crate
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: aborting due to 4 previous errors
41
42 Some errors have detailed explanations: E0117, E0321.
43 For more information about an error, try `rustc --explain E0117`.