Skip to content

Commit f4ec0e7

Browse files
committed
Auto merge of rust-lang#96322 - matthiaskrgr:rollup-9xejxrf, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - rust-lang#96272 (Update `validate_uninhabited_zsts.rs` test after MIR building changes) - rust-lang#96273 (Make `E0117` error clear) - rust-lang#96315 (Make the lifetime accurate which is used in the region constraints part) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5ffebc2 + eeed267 commit f4ec0e7

26 files changed

+94
-70
lines changed

compiler/rustc_borrowck/src/constraints/graph.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> RegionGraph<'s, 'tcx, D> {
190190

191191
/// Given a region `R`, iterate over all regions `R1` such that
192192
/// there exists a constraint `R: R1`.
193-
crate fn outgoing_regions(&self, region_sup: RegionVid) -> Successors<'_, 'tcx, D> {
193+
crate fn outgoing_regions(&self, region_sup: RegionVid) -> Successors<'s, 'tcx, D> {
194194
Successors {
195195
edges: self.constraint_graph.outgoing_edges(region_sup, self.set, self.static_region),
196196
}
@@ -225,10 +225,7 @@ impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::WithSuccessors for RegionGraph
225225
}
226226
}
227227

228-
impl<'s, 'graph, 'tcx, D: ConstraintGraphDirecton> graph::GraphSuccessors<'graph>
229-
for RegionGraph<'s, 'tcx, D>
230-
{
228+
impl<'s, 'tcx, D: ConstraintGraphDirecton> graph::GraphSuccessors<'_> for RegionGraph<'s, 'tcx, D> {
231229
type Item = RegionVid;
232-
// FIXME - why can't this be `'graph, 'tcx`
233-
type Iter = Successors<'graph, 'graph, D>;
230+
type Iter = Successors<'s, 'tcx, D>;
234231
}

compiler/rustc_typeck/src/coherence/orphan.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn orphan_check_impl(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGua
5050
tcx,
5151
sp,
5252
tr.path.span,
53+
trait_ref.self_ty(),
5354
impl_.self_ty.span,
5455
&impl_.generics,
5556
err,
@@ -201,18 +202,23 @@ fn emit_orphan_check_error<'tcx>(
201202
tcx: TyCtxt<'tcx>,
202203
sp: Span,
203204
trait_span: Span,
205+
self_ty: Ty<'tcx>,
204206
self_ty_span: Span,
205207
generics: &hir::Generics<'tcx>,
206208
err: traits::OrphanCheckErr<'tcx>,
207209
) -> Result<!, ErrorGuaranteed> {
208210
Err(match err {
209211
traits::OrphanCheckErr::NonLocalInputType(tys) => {
212+
let msg = match self_ty.kind() {
213+
ty::Adt(..) => "can be implemented for types defined outside of the crate",
214+
_ if self_ty.is_primitive() => "can be implemented for primitive types",
215+
_ => "can be implemented for arbitrary types",
216+
};
210217
let mut err = struct_span_err!(
211218
tcx.sess,
212219
sp,
213220
E0117,
214-
"only traits defined in the current crate can be implemented for \
215-
arbitrary types"
221+
"only traits defined in the current crate {msg}"
216222
);
217223
err.span_label(sp, "impl doesn't use only types from inside the current crate");
218224
for (ty, is_target_ty) in &tys {

src/test/ui/coherence/coherence-cow.re_a.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-cow.rs:18:1
33
|
44
LL | impl<T> Remote for Pair<T,Cover<T>> { }

src/test/ui/coherence/coherence-cow.re_b.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-cow.rs:22:1
33
|
44
LL | impl<T> Remote for Pair<Cover<T>,T> { }

src/test/ui/coherence/coherence-cow.re_c.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-cow.rs:26:1
33
|
44
LL | impl<T,U> Remote for Pair<Cover<T>,U> { }

src/test/ui/coherence/coherence-impls-copy.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/coherence-impls-copy.rs:5:1
33
|
44
LL | impl Copy for i32 {}

src/test/ui/coherence/coherence-orphan.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/coherence-orphan.rs:10:1
33
|
44
LL | impl TheTrait<usize> for isize { }
@@ -10,7 +10,7 @@ LL | impl TheTrait<usize> for isize { }
1010
|
1111
= note: define and implement a trait or new type instead
1212

13-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
13+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
1414
--> $DIR/coherence-orphan.rs:17:1
1515
|
1616
LL | impl !Send for Vec<isize> { }

src/test/ui/coherence/coherence-overlapping-pairs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-overlapping-pairs.rs:8:1
33
|
44
LL | impl<T> Remote for lib::Pair<T,Foo> { }

src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/coherence-pair-covered-uncovered-1.rs:12:1
33
|
44
LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { }

src/test/ui/coherence/coherence-pair-covered-uncovered.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-pair-covered-uncovered.rs:8:1
33
|
44
LL | impl<T,U> Remote for Pair<T,Local<U>> { }

src/test/ui/coherence/coherence-vec-local-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-vec-local-2.rs:11:1
33
|
44
LL | impl<T> Remote for Vec<Local<T>> { }

src/test/ui/coherence/coherence-vec-local.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence-vec-local.rs:11:1
33
|
44
LL | impl Remote for Vec<Local> { }

src/test/ui/coherence/coherence_local_err_struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/coherence_local_err_struct.rs:14:1
33
|
44
LL | impl lib::MyCopy for lib::MyStruct<MyType> { }

src/test/ui/coherence/impl-foreign-for-foreign.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/impl-foreign-for-foreign.rs:10:1
33
|
44
LL | impl Remote for i32 {

src/test/ui/coherence/impl-foreign-for-foreign[foreign].stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/impl-foreign-for-foreign[foreign].rs:10:1
33
|
44
LL | impl Remote1<Rc<i32>> for i32 {
@@ -10,7 +10,7 @@ LL | impl Remote1<Rc<i32>> for i32 {
1010
|
1111
= note: define and implement a trait or new type instead
1212

13-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
13+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
1414
--> $DIR/impl-foreign-for-foreign[foreign].rs:14:1
1515
|
1616
LL | impl Remote1<Rc<Local>> for f64 {
@@ -22,7 +22,7 @@ LL | impl Remote1<Rc<Local>> for f64 {
2222
|
2323
= note: define and implement a trait or new type instead
2424

25-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
25+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
2626
--> $DIR/impl-foreign-for-foreign[foreign].rs:18:1
2727
|
2828
LL | impl<T> Remote1<Rc<T>> for f32 {

src/test/ui/coherence/impl-foreign-for-fundamental[foreign].stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/impl-foreign-for-fundamental[foreign].rs:10:1
33
|
44
LL | impl Remote for Box<i32> {
@@ -10,7 +10,7 @@ LL | impl Remote for Box<i32> {
1010
|
1111
= note: define and implement a trait or new type instead
1212

13-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
13+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
1414
--> $DIR/impl-foreign-for-fundamental[foreign].rs:14:1
1515
|
1616
LL | impl<T> Remote for Box<Rc<T>> {

src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/impl-foreign[foreign]-for-foreign.rs:10:1
33
|
44
LL | impl Remote1<u32> for f64 {

src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/impl-foreign[fundemental[foreign]]-for-foreign.rs:11:1
33
|
44
LL | impl Remote1<Box<String>> for i32 {
@@ -11,7 +11,7 @@ LL | impl Remote1<Box<String>> for i32 {
1111
|
1212
= note: define and implement a trait or new type instead
1313

14-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
14+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
1515
--> $DIR/impl-foreign[fundemental[foreign]]-for-foreign.rs:15:1
1616
|
1717
LL | impl Remote1<Box<Rc<i32>>> for f64 {
@@ -24,7 +24,7 @@ LL | impl Remote1<Box<Rc<i32>>> for f64 {
2424
|
2525
= note: define and implement a trait or new type instead
2626

27-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
27+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
2828
--> $DIR/impl-foreign[fundemental[foreign]]-for-foreign.rs:19:1
2929
|
3030
LL | impl<T> Remote1<Box<Rc<T>>> for f32 {

src/test/ui/coherence/impl[t]-foreign-for-foreign[t].stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
22
--> $DIR/impl[t]-foreign-for-foreign[t].rs:11:1
33
|
44
LL | impl Remote for Rc<Local> {
@@ -9,7 +9,7 @@ LL | impl Remote for Rc<Local> {
99
|
1010
= note: define and implement a trait or new type instead
1111

12-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
12+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
1313
--> $DIR/impl[t]-foreign-for-foreign[t].rs:16:1
1414
|
1515
LL | impl<T> Remote for Arc<T> {

src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr

+21-14
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ LL | unsafe { std::mem::transmute(()) }
77
| transmuting to uninhabited type
88
| inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
99
...
10-
LL | const FOO: [Empty; 3] = [foo(); 3];
11-
| ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:13:26
10+
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
11+
| ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:20:33
1212

13-
error[E0080]: evaluation of constant value failed
14-
--> $DIR/validate_uninhabited_zsts.rs:16:35
13+
error[E0080]: it is undefined behavior to use this value
14+
--> $DIR/validate_uninhabited_zsts.rs:23:1
15+
|
16+
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0].0: encountered a value of uninhabited type empty::Void
1518
|
16-
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
17-
| ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
19+
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
20+
= note: the raw bytes of the constant (size: 0, align: 1) {}
1821

1922
warning: the type `!` does not permit zero-initialization
2023
--> $DIR/validate_uninhabited_zsts.rs:4:14
@@ -28,16 +31,20 @@ LL | unsafe { std::mem::transmute(()) }
2831
= note: `#[warn(invalid_value)]` on by default
2932
= note: the `!` type has no valid value
3033

31-
warning: the type `Empty` does not permit zero-initialization
32-
--> $DIR/validate_uninhabited_zsts.rs:16:35
34+
warning: the type `empty::Empty` does not permit zero-initialization
35+
--> $DIR/validate_uninhabited_zsts.rs:23:42
36+
|
37+
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
38+
| ^^^^^^^^^^^^^^^^^^^^^^^
39+
| |
40+
| this code causes undefined behavior when executed
41+
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
3342
|
34-
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
35-
| ^^^^^^^^^^^^^^^^^^^^^^^
36-
| |
37-
| this code causes undefined behavior when executed
38-
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
43+
note: enums with no variants have no valid value (in this struct field)
44+
--> $DIR/validate_uninhabited_zsts.rs:16:22
3945
|
40-
= note: enums with no variants have no valid value
46+
LL | pub struct Empty(Void);
47+
| ^^^^
4148

4249
error: aborting due to 2 previous errors; 2 warnings emitted
4350

src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr

+21-14
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ LL | unsafe { std::mem::transmute(()) }
77
| transmuting to uninhabited type
88
| inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
99
...
10-
LL | const FOO: [Empty; 3] = [foo(); 3];
11-
| ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:13:26
10+
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
11+
| ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:20:33
1212

13-
error[E0080]: evaluation of constant value failed
14-
--> $DIR/validate_uninhabited_zsts.rs:16:35
13+
error[E0080]: it is undefined behavior to use this value
14+
--> $DIR/validate_uninhabited_zsts.rs:23:1
15+
|
16+
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0].0: encountered a value of uninhabited type empty::Void
1518
|
16-
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
17-
| ^^^^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
19+
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
20+
= note: the raw bytes of the constant (size: 0, align: 1) {}
1821

1922
warning: the type `!` does not permit zero-initialization
2023
--> $DIR/validate_uninhabited_zsts.rs:4:14
@@ -28,16 +31,20 @@ LL | unsafe { std::mem::transmute(()) }
2831
= note: `#[warn(invalid_value)]` on by default
2932
= note: the `!` type has no valid value
3033

31-
warning: the type `Empty` does not permit zero-initialization
32-
--> $DIR/validate_uninhabited_zsts.rs:16:35
34+
warning: the type `empty::Empty` does not permit zero-initialization
35+
--> $DIR/validate_uninhabited_zsts.rs:23:42
36+
|
37+
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
38+
| ^^^^^^^^^^^^^^^^^^^^^^^
39+
| |
40+
| this code causes undefined behavior when executed
41+
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
3342
|
34-
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
35-
| ^^^^^^^^^^^^^^^^^^^^^^^
36-
| |
37-
| this code causes undefined behavior when executed
38-
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
43+
note: enums with no variants have no valid value (in this struct field)
44+
--> $DIR/validate_uninhabited_zsts.rs:16:22
3945
|
40-
= note: enums with no variants have no valid value
46+
LL | pub struct Empty(Void);
47+
| ^^^^
4148

4249
error: aborting due to 2 previous errors; 2 warnings emitted
4350

src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,23 @@ const fn foo() -> ! {
66
//~| WARN the type `!` does not permit zero-initialization [invalid_value]
77
}
88

9-
#[derive(Clone, Copy)]
10-
enum Empty { }
9+
// Type defined in a submodule, so that it is not "visibly"
10+
// uninhabited (which would change interpreter behavior).
11+
pub mod empty {
12+
#[derive(Clone, Copy)]
13+
enum Void {}
14+
15+
#[derive(Clone, Copy)]
16+
pub struct Empty(Void);
17+
}
1118

1219
#[warn(const_err)]
13-
const FOO: [Empty; 3] = [foo(); 3];
20+
const FOO: [empty::Empty; 3] = [foo(); 3];
1421

1522
#[warn(const_err)]
16-
const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
17-
//~^ ERROR evaluation of constant value failed
18-
//~| WARN the type `Empty` does not permit zero-initialization
23+
const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
24+
//~^ ERROR it is undefined behavior to use this value
25+
//~| WARN the type `empty::Empty` does not permit zero-initialization
1926

2027
fn main() {
2128
FOO;

src/test/ui/error-codes/E0117.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/E0117.rs:1:1
33
|
44
LL | impl Drop for u32 {}

src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub struct Int(i32);
44

55
impl const std::ops::Add for i32 { //~ ERROR type annotations needed
6-
//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types
6+
//~^ ERROR only traits defined in the current crate can be implemented for primitive types
77
type Output = Self;
88

99
fn add(self, rhs: Self) -> Self {

src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1+
error[E0117]: only traits defined in the current crate can be implemented for primitive types
22
--> $DIR/const-and-non-const-impl.rs:5:1
33
|
44
LL | impl const std::ops::Add for i32 {

src/test/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ error[E0321]: cross-crate traits with a default impl, like `DefaultedTrait`, can
2626
LL | impl DefaultedTrait for Box<C> { }
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait for type in another crate
2828

29-
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
29+
error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
3030
--> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:22:1
3131
|
3232
LL | impl DefaultedTrait for lib::Something<C> { }

0 commit comments

Comments
 (0)