]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr
b8b743d3f40723116e525087bddc7f96f559a692
[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:13:1
3    |
4 LL | impl DefaultedTrait for (A,) { } //~ ERROR E0117
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
6    |
7    = note: the impl does not reference any types defined in this crate
8    = note: define and implement a trait or new type instead
9
10 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
11   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:16:1
12    |
13 LL | impl !DefaultedTrait for (B,) { } //~ ERROR E0117
14    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
15    |
16    = note: the impl does not reference any types defined in this crate
17    = note: define and implement a trait or new type instead
18
19 error[E0321]: cross-crate traits with a default impl, like `lib::DefaultedTrait`, can only be implemented for a struct/enum type defined in the current crate
20   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:20:1
21    |
22 LL | impl DefaultedTrait for Box<C> { } //~ ERROR E0321
23    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait for type in another crate
24
25 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
26   --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:21:1
27    |
28 LL | impl DefaultedTrait for lib::Something<C> { } //~ ERROR E0117
29    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate
30    |
31    = note: the impl does not reference any types defined in this crate
32    = note: define and implement a trait or new type instead
33
34 error: aborting due to 4 previous errors
35
36 Some errors occurred: E0117, E0321.
37 For more information about an error, try `rustc --explain E0117`.