Skip to content

Commit 51742be

Browse files
committed
specialization_graph: avoid trimmed paths for OverlapError
1 parent c5a6131 commit 51742be

34 files changed

+75
-73
lines changed

compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use super::OverlapError;
33
use crate::traits;
44
use rustc_hir::def_id::DefId;
55
use rustc_middle::ty::fast_reject::{self, SimplifiedType};
6+
use rustc_middle::ty::print::with_no_trimmed_paths;
67
use rustc_middle::ty::{self, TyCtxt, TypeFoldable};
78

89
pub use rustc_middle::traits::specialization_graph::*;
@@ -102,7 +103,8 @@ impl ChildrenExt for Children {
102103
let trait_ref = overlap.impl_header.trait_ref.unwrap();
103104
let self_ty = trait_ref.self_ty();
104105

105-
OverlapError {
106+
// FIXME: should postpone string formatting until we decide to actually emit.
107+
with_no_trimmed_paths(|| OverlapError {
106108
with_impl: possible_sibling,
107109
trait_desc: trait_ref.print_only_trait_path().to_string(),
108110
// Only report the `Self` type if it has at least
@@ -115,7 +117,7 @@ impl ChildrenExt for Children {
115117
},
116118
intercrate_ambiguity_causes: overlap.intercrate_ambiguity_causes,
117119
involves_placeholder: overlap.involves_placeholder,
118-
}
120+
})
119121
};
120122

121123
let report_overlap_error = |overlap: traits::coherence::OverlapResult<'_>,

src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `GoMut` for type `MyThingy`:
1+
error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`:
22
--> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:15:1
33
|
44
LL | impl GoMut for MyThingy {

src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
1+
error[E0751]: found both positive and negative implementation of trait `std::marker::Send` for type `TestType<_>`:
22
--> $DIR/coherence-conflicting-negative-trait-impl.rs:11:1
33
|
44
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
@@ -7,7 +7,7 @@ LL |
77
LL | impl<T: MyTrait> !Send for TestType<T> {}
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
99

10-
error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>`:
10+
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`:
1111
--> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1
1212
|
1313
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}

src/test/ui/coherence/coherence-cross-crate-conflict.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Foo` for type `isize`:
1+
error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`:
22
--> $DIR/coherence-cross-crate-conflict.rs:9:1
33
|
44
LL | impl<A> Foo for A {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Copy` for type `i32`:
1+
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`:
22
--> $DIR/coherence-impls-copy.rs:5:1
33
|
44
LL | impl Copy for i32 {}
@@ -7,7 +7,7 @@ LL | impl Copy for i32 {}
77
= note: conflicting implementation in crate `core`:
88
- impl Copy for i32;
99

10-
error[E0119]: conflicting implementations of trait `Copy` for type `&NotSync`:
10+
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
1111
--> $DIR/coherence-impls-copy.rs:29:1
1212
|
1313
LL | impl Copy for &'static NotSync {}
@@ -17,7 +17,7 @@ LL | impl Copy for &'static NotSync {}
1717
- impl<T> Copy for &T
1818
where T: ?Sized;
1919

20-
error[E0119]: conflicting implementations of trait `Copy` for type `&[NotSync]`:
20+
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
2121
--> $DIR/coherence-impls-copy.rs:34:1
2222
|
2323
LL | impl Copy for &'static [NotSync] {}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Send` for type `&[NotSync]`:
1+
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]`:
22
--> $DIR/coherence-impls-send.rs:25:1
33
|
44
LL | unsafe impl Send for &'static [NotSync] {}

src/test/ui/coherence/coherence-overlap-issue-23516.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`:
1+
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
22
--> $DIR/coherence-overlap-issue-23516.rs:8:1
33
|
44
LL | impl<T:Sugar> Sweet for T { }
55
| ------------------------- first implementation here
66
LL | impl<U:Sugar> Sweet for Box<U> { }
7-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Box<_>`
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
88
|
99
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
1010

src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0119]: conflicting implementations of trait `Foo<_>` for type `Option<_>`:
1+
error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`:
22
--> $DIR/coherence-projection-conflict-ty-param.rs:10:1
33
|
44
LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
55
| ---------------------------------------- first implementation here
66
LL |
77
LL | impl<T, U> Foo<T> for Option<U> { }
8-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Option<_>`
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>`
99

1010
error: aborting due to previous error
1111

src/test/ui/coherence/coherence-wasm-bindgen.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn Fn(&_) -> _`:
1+
error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _`:
22
--> $DIR/coherence-wasm-bindgen.rs:28:1
33
|
44
LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
@@ -16,7 +16,7 @@ LL | | R: ReturnWasmAbi,
1616
... |
1717
LL | |
1818
LL | | }
19-
| |_^ conflicting implementation for `&dyn Fn(&_) -> _`
19+
| |_^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _`
2020
|
2121
note: the lint level is defined here
2222
--> $DIR/coherence-wasm-bindgen.rs:10:9

src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFundamentalStruct<(MyType,)>`:
1+
error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`:
22
--> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1
33
|
44
LL | impl<T: lib::MyCopy> MyTrait for T { }
55
| ---------------------------------- first implementation here
66
...
77
LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
8-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFundamentalStruct<(MyType,)>`
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>`
99
|
1010
= note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions
1111

src/test/ui/coherence/coherence_copy_like_err_struct.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0119]: conflicting implementations of trait `MyTrait` for type `MyStruct<MyType>`:
1+
error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`:
22
--> $DIR/coherence_copy_like_err_struct.rs:19:1
33
|
44
LL | impl<T: lib::MyCopy> MyTrait for T { }
55
| ---------------------------------- first implementation here
66
...
77
LL | impl MyTrait for lib::MyStruct<MyType> { }
8-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct<MyType>`
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>`
99
|
1010
= note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions
1111

src/test/ui/error-codes/e0119/complex-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `External` for type `(Q, M<'_, '_, '_, Box<_>, _, _>)`:
1+
error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)`:
22
--> $DIR/complex-impl.rs:9:1
33
|
44
LL | impl<R> External for (Q, R) {}

src/test/ui/error-codes/e0119/conflict-with-std.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `AsRef<Q>` for type `Box<Q>`:
1+
error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`:
22
--> $DIR/conflict-with-std.rs:5:1
33
|
44
LL | impl AsRef<Q> for Box<Q> {
@@ -8,7 +8,7 @@ LL | impl AsRef<Q> for Box<Q> {
88
- impl<T> AsRef<T> for Box<T>
99
where T: ?Sized;
1010

11-
error[E0119]: conflicting implementations of trait `From<S>` for type `S`:
11+
error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:
1212
--> $DIR/conflict-with-std.rs:12:1
1313
|
1414
LL | impl From<S> for S {
@@ -17,7 +17,7 @@ LL | impl From<S> for S {
1717
= note: conflicting implementation in crate `core`:
1818
- impl<T> From<T> for T;
1919

20-
error[E0119]: conflicting implementations of trait `TryFrom<X>` for type `X`:
20+
error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:
2121
--> $DIR/conflict-with-std.rs:19:1
2222
|
2323
LL | impl TryFrom<X> for X {

src/test/ui/error-codes/e0119/issue-23563.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `LolFrom<&[_]>` for type `LocalType<_>`:
1+
error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`:
22
--> $DIR/issue-23563.rs:13:1
33
|
44
LL | impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {

src/test/ui/error-codes/e0119/issue-27403.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Into<_>` for type `GenX<_>`:
1+
error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`:
22
--> $DIR/issue-27403.rs:5:1
33
|
44
LL | impl<S> Into<S> for GenX<S> {

src/test/ui/error-codes/e0119/issue-28981.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Deref` for type `&_`:
1+
error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`:
22
--> $DIR/issue-28981.rs:5:1
33
|
44
LL | impl<Foo> Deref for Foo { }

src/test/ui/error-codes/e0119/so-37347311.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `From<MyError<_>>` for type `MyError<_>`:
1+
error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`:
22
--> $DIR/so-37347311.rs:11:1
33
|
44
LL | impl<S: Storage> From<S::Error> for MyError<S> {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Drop` for type `MyStruct`:
1+
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`:
22
--> $DIR/issue-28568.rs:7:1
33
|
44
LL | impl Drop for MyStruct {

src/test/ui/issues/issue-33140-hack-boundaries.stderr

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn Send + 'static)`:
1+
error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)`:
22
--> $DIR/issue-33140-hack-boundaries.rs:18:1
33
|
44
LL | impl Trait1 for dyn Send {}
55
| ------------------------ first implementation here
66
LL | impl Trait1 for dyn Send {}
7-
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
88

9-
error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn Send + 'static)`:
9+
error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn std::marker::Send + 'static)`:
1010
--> $DIR/issue-33140-hack-boundaries.rs:25:1
1111
|
1212
LL | impl Trait2 for dyn Send {}
1313
| ------------------------ positive implementation here
1414
LL | impl !Trait2 for dyn Send {}
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
1616

17-
error[E0119]: conflicting implementations of trait `Trait3<(dyn Sync + 'static)>` for type `(dyn Send + 'static)`:
17+
error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)`:
1818
--> $DIR/issue-33140-hack-boundaries.rs:32:1
1919
|
2020
LL | impl Trait3<dyn Sync> for dyn Send {}
2121
| ---------------------------------- first implementation here
2222
LL | impl Trait3<dyn Sync> for dyn Send {}
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
2424

25-
error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn Send + 'static)`:
25+
error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)`:
2626
--> $DIR/issue-33140-hack-boundaries.rs:39:1
2727
|
2828
LL | impl<T: ?Sized> Trait4a for T {}
2929
| ----------------------------- first implementation here
3030
LL | impl Trait4a for dyn Send {}
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
3232

3333
error[E0119]: conflicting implementations of trait `Trait4b` for type `()`:
3434
--> $DIR/issue-33140-hack-boundaries.rs:46:1
@@ -38,29 +38,29 @@ LL | impl Trait4b for () {}
3838
LL | impl Trait4b for () {}
3939
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
4040

41-
error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + Send + 'static)`:
41+
error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)`:
4242
--> $DIR/issue-33140-hack-boundaries.rs:53:1
4343
|
4444
LL | impl Trait4c for dyn Trait1 + Send {}
4545
| ---------------------------------- first implementation here
4646
LL | impl Trait4c for dyn Trait1 + Send {}
47-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + Send + 'static)`
47+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + std::marker::Send + 'static)`
4848

49-
error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn Send`:
49+
error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send`:
5050
--> $DIR/issue-33140-hack-boundaries.rs:60:1
5151
|
5252
LL | impl<'a> Trait4d for dyn Send + 'a {}
5353
| ---------------------------------- first implementation here
5454
LL | impl<'a> Trait4d for dyn Send + 'a {}
55-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send`
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn std::marker::Send`
5656

57-
error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn Send + 'static)`:
57+
error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)`:
5858
--> $DIR/issue-33140-hack-boundaries.rs:67:1
5959
|
6060
LL | impl Trait5 for dyn Send {}
6161
| ------------------------ first implementation here
6262
LL | impl Trait5 for dyn Send where u32: Copy {}
63-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
63+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
6464

6565
error: aborting due to 8 previous errors
6666

src/test/ui/issues/issue-33140-traitobject-crate.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
1+
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
22
--> $DIR/issue-33140-traitobject-crate.rs:85:1
33
|
44
LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { }
55
| ------------------------------------------------------ first implementation here
66
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
7-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
88
|
99
note: the lint level is defined here
1010
--> $DIR/issue-33140-traitobject-crate.rs:3:9
@@ -14,26 +14,26 @@ LL | #![warn(order_dependent_trait_objects)]
1414
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1515
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
1616

17-
warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
17+
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
1818
--> $DIR/issue-33140-traitobject-crate.rs:88:1
1919
|
2020
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
2121
| ------------------------------------------------------------- first implementation here
2222
...
2323
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
2525
|
2626
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2727
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
2828

29-
warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
29+
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
3030
--> $DIR/issue-33140-traitobject-crate.rs:92:1
3131
|
3232
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
3333
| ------------------------------------------------------ first implementation here
3434
...
3535
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
36-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
36+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
3737
|
3838
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3939
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`:
1+
error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`:
22
--> $DIR/issue-33140.rs:9:1
33
|
44
LL | impl Trait for dyn Send + Sync {
55
| ------------------------------ first implementation here
66
...
77
LL | impl Trait for dyn Sync + Send {
8-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
99

10-
error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn Send + Sync + 'static)`:
10+
error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`:
1111
--> $DIR/issue-33140.rs:22:1
1212
|
1313
LL | impl Trait2 for dyn Send + Sync {
1414
| ------------------------------- first implementation here
1515
...
1616
LL | impl Trait2 for dyn Sync + Send + Sync {
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
1818

1919
error[E0592]: duplicate definitions with name `abc`
2020
--> $DIR/issue-33140.rs:29:5

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Drop` for type `Box<_>`:
1+
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_>`:
22
--> $DIR/issue-41974.rs:7:1
33
|
44
LL | impl<T> Drop for T where T: A {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0119]: conflicting implementations of trait `Trait1<Box<_>>` for type `A`:
1+
error[E0119]: conflicting implementations of trait `Trait1<std::boxed::Box<_>>` for type `A`:
22
--> $DIR/issue-43355.rs:13:1
33
|
44
LL | impl<X, T> Trait1<X> for T where T: Trait2<X> {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Regression test for #48728, an ICE that occurred computing
22
// coherence "help" information.
33

4-
#[derive(Clone)] //~ ERROR conflicting implementations of trait `Clone`
4+
#[derive(Clone)] //~ ERROR conflicting implementations of trait `std::clone::Clone`
55
struct Node<T: ?Sized>(Box<T>);
66

77
impl<T: Clone + ?Sized> Clone for Node<[T]> {

0 commit comments

Comments
 (0)