Skip to content

Commit 485aae0

Browse files
authored
Rollup merge of rust-lang#63264 - arielb1:revert-private-coherence-errors, r=estebank
Revert "Rollup merge of rust-lang#62696 - chocol4te:fix_#62194, r=estebank" This reverts commit df21a6f (rust-lang#62696), reversing changes made to cc16d04. That PR makes error messages worse than before, and we couldn't come up with a way of actually making them better, so revert it for now. Any idea for making this error message better is welcome! Fixes rust-lang#63145. r? @estebank
2 parents 7a0dd84 + 95f29aa commit 485aae0

11 files changed

+22
-7
lines changed

src/librustc/traits/specialize/mod.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -366,13 +366,8 @@ pub(super) fn specialization_graph_provider(
366366
}
367367
}
368368

369-
let access_levels = tcx.privacy_access_levels(impl_def_id.krate);
370-
if let Some(id) = tcx.hir().as_local_hir_id(impl_def_id) {
371-
if access_levels.is_exported(id) || access_levels.is_public(id) {
372-
for cause in &overlap.intercrate_ambiguity_causes {
373-
cause.add_intercrate_ambiguity_hint(&mut err);
374-
}
375-
}
369+
for cause in &overlap.intercrate_ambiguity_causes {
370+
cause.add_intercrate_ambiguity_hint(&mut err);
376371
}
377372

378373
if overlap.involves_placeholder {

src/test/ui/coherence/coherence-overlap-upstream.old.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | impl<T> Foo for T where T: Remote {}
55
| --------------------------------- first implementation here
66
LL | impl Foo for i16 {}
77
| ^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
8+
|
9+
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
810

911
error: aborting due to previous error
1012

src/test/ui/coherence/coherence-overlap-upstream.re.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ LL | impl<T> Foo for T where T: Remote {}
55
| --------------------------------- first implementation here
66
LL | impl Foo for i16 {}
77
| ^^^^^^^^^^^^^^^^ conflicting implementation for `i16`
8+
|
9+
= note: upstream crates may add new impl of trait `coherence_lib::Remote` for type `i16` in future versions
810

911
error: aborting due to previous error
1012

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.old.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | impl<T: lib::MyCopy> MyTrait for T { }
66
...
77
LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>`
9+
|
10+
= note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.re.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | impl<T: lib::MyCopy> MyTrait for T { }
66
...
77
LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>`
9+
|
10+
= note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/coherence/coherence_copy_like_err_struct.old.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | impl<T: lib::MyCopy> MyTrait for T { }
66
...
77
LL | impl MyTrait for lib::MyStruct<MyType> { }
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>`
9+
|
10+
= note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/coherence/coherence_copy_like_err_struct.re.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | impl<T: lib::MyCopy> MyTrait for T { }
66
...
77
LL | impl MyTrait for lib::MyStruct<MyType> { }
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>`
9+
|
10+
= note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/coherence/coherence_copy_like_err_tuple.old.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | impl<T: lib::MyCopy> MyTrait for T { }
66
...
77
LL | impl MyTrait for (MyType,) { }
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(MyType,)`
9+
|
10+
= note: upstream crates may add new impl of trait `lib::MyCopy` for type `(MyType,)` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/coherence/coherence_copy_like_err_tuple.re.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | impl<T: lib::MyCopy> MyTrait for T { }
66
...
77
LL | impl MyTrait for (MyType,) { }
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(MyType,)`
9+
|
10+
= note: upstream crates may add new impl of trait `lib::MyCopy` for type `(MyType,)` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/issues/issue-48728.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | #[derive(Clone)]
66
...
77
LL | impl<T: Clone + ?Sized> Clone for Node<[T]> {
88
| ------------------------------------------- first implementation here
9+
|
10+
= note: upstream crates may add new impl of trait `std::clone::Clone` for type `[_]` in future versions
911

1012
error: aborting due to previous error
1113

src/test/ui/specialization/issue-52050.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ LL | | }
1010
LL |
1111
LL | impl IntoPyDictPointer for ()
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
13+
|
14+
= note: upstream crates may add new impl of trait `std::iter::Iterator` for type `()` in future versions
1315

1416
error: aborting due to previous error
1517

0 commit comments

Comments
 (0)