mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 21:53:56 +00:00
specialization_graph: avoid trimmed paths for OverlapError
This commit is contained in:
parent
c5a61319da
commit
51742be6d8
@ -3,6 +3,7 @@ use super::OverlapError;
|
||||
use crate::traits;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::ty::fast_reject::{self, SimplifiedType};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::{self, TyCtxt, TypeFoldable};
|
||||
|
||||
pub use rustc_middle::traits::specialization_graph::*;
|
||||
@ -102,7 +103,8 @@ impl ChildrenExt for Children {
|
||||
let trait_ref = overlap.impl_header.trait_ref.unwrap();
|
||||
let self_ty = trait_ref.self_ty();
|
||||
|
||||
OverlapError {
|
||||
// FIXME: should postpone string formatting until we decide to actually emit.
|
||||
with_no_trimmed_paths(|| OverlapError {
|
||||
with_impl: possible_sibling,
|
||||
trait_desc: trait_ref.print_only_trait_path().to_string(),
|
||||
// Only report the `Self` type if it has at least
|
||||
@ -115,7 +117,7 @@ impl ChildrenExt for Children {
|
||||
},
|
||||
intercrate_ambiguity_causes: overlap.intercrate_ambiguity_causes,
|
||||
involves_placeholder: overlap.involves_placeholder,
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
let report_overlap_error = |overlap: traits::coherence::OverlapResult<'_>,
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `GoMut` for type `MyThingy`:
|
||||
error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`:
|
||||
--> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:15:1
|
||||
|
|
||||
LL | impl GoMut for MyThingy {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
|
||||
error[E0751]: found both positive and negative implementation of trait `std::marker::Send` for type `TestType<_>`:
|
||||
--> $DIR/coherence-conflicting-negative-trait-impl.rs:11:1
|
||||
|
|
||||
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
|
||||
@ -7,7 +7,7 @@ LL |
|
||||
LL | impl<T: MyTrait> !Send for TestType<T> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>`:
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`:
|
||||
--> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1
|
||||
|
|
||||
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Foo` for type `isize`:
|
||||
error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`:
|
||||
--> $DIR/coherence-cross-crate-conflict.rs:9:1
|
||||
|
|
||||
LL | impl<A> Foo for A {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Copy` for type `i32`:
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`:
|
||||
--> $DIR/coherence-impls-copy.rs:5:1
|
||||
|
|
||||
LL | impl Copy for i32 {}
|
||||
@ -7,7 +7,7 @@ LL | impl Copy for i32 {}
|
||||
= note: conflicting implementation in crate `core`:
|
||||
- impl Copy for i32;
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Copy` for type `&NotSync`:
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
|
||||
--> $DIR/coherence-impls-copy.rs:29:1
|
||||
|
|
||||
LL | impl Copy for &'static NotSync {}
|
||||
@ -17,7 +17,7 @@ LL | impl Copy for &'static NotSync {}
|
||||
- impl<T> Copy for &T
|
||||
where T: ?Sized;
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Copy` for type `&[NotSync]`:
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
|
||||
--> $DIR/coherence-impls-copy.rs:34:1
|
||||
|
|
||||
LL | impl Copy for &'static [NotSync] {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Send` for type `&[NotSync]`:
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]`:
|
||||
--> $DIR/coherence-impls-send.rs:25:1
|
||||
|
|
||||
LL | unsafe impl Send for &'static [NotSync] {}
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`:
|
||||
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
|
||||
--> $DIR/coherence-overlap-issue-23516.rs:8:1
|
||||
|
|
||||
LL | impl<T:Sugar> Sweet for T { }
|
||||
| ------------------------- first implementation here
|
||||
LL | impl<U:Sugar> Sweet for Box<U> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Box<_>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>`
|
||||
|
|
||||
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0119]: conflicting implementations of trait `Foo<_>` for type `Option<_>`:
|
||||
error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`:
|
||||
--> $DIR/coherence-projection-conflict-ty-param.rs:10:1
|
||||
|
|
||||
LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
|
||||
| ---------------------------------------- first implementation here
|
||||
LL |
|
||||
LL | impl<T, U> Foo<T> for Option<U> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Option<_>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn Fn(&_) -> _`:
|
||||
error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _`:
|
||||
--> $DIR/coherence-wasm-bindgen.rs:28:1
|
||||
|
|
||||
LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
|
||||
@ -16,7 +16,7 @@ LL | | R: ReturnWasmAbi,
|
||||
... |
|
||||
LL | |
|
||||
LL | | }
|
||||
| |_^ conflicting implementation for `&dyn Fn(&_) -> _`
|
||||
| |_^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _`
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/coherence-wasm-bindgen.rs:10:9
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFundamentalStruct<(MyType,)>`:
|
||||
error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`:
|
||||
--> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1
|
||||
|
|
||||
LL | impl<T: lib::MyCopy> MyTrait for T { }
|
||||
| ---------------------------------- first implementation here
|
||||
...
|
||||
LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFundamentalStruct<(MyType,)>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>`
|
||||
|
|
||||
= note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
error[E0119]: conflicting implementations of trait `MyTrait` for type `MyStruct<MyType>`:
|
||||
error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`:
|
||||
--> $DIR/coherence_copy_like_err_struct.rs:19:1
|
||||
|
|
||||
LL | impl<T: lib::MyCopy> MyTrait for T { }
|
||||
| ---------------------------------- first implementation here
|
||||
...
|
||||
LL | impl MyTrait for lib::MyStruct<MyType> { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct<MyType>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>`
|
||||
|
|
||||
= note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `External` for type `(Q, M<'_, '_, '_, Box<_>, _, _>)`:
|
||||
error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)`:
|
||||
--> $DIR/complex-impl.rs:9:1
|
||||
|
|
||||
LL | impl<R> External for (Q, R) {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `AsRef<Q>` for type `Box<Q>`:
|
||||
error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`:
|
||||
--> $DIR/conflict-with-std.rs:5:1
|
||||
|
|
||||
LL | impl AsRef<Q> for Box<Q> {
|
||||
@ -8,7 +8,7 @@ LL | impl AsRef<Q> for Box<Q> {
|
||||
- impl<T> AsRef<T> for Box<T>
|
||||
where T: ?Sized;
|
||||
|
||||
error[E0119]: conflicting implementations of trait `From<S>` for type `S`:
|
||||
error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:
|
||||
--> $DIR/conflict-with-std.rs:12:1
|
||||
|
|
||||
LL | impl From<S> for S {
|
||||
@ -17,7 +17,7 @@ LL | impl From<S> for S {
|
||||
= note: conflicting implementation in crate `core`:
|
||||
- impl<T> From<T> for T;
|
||||
|
||||
error[E0119]: conflicting implementations of trait `TryFrom<X>` for type `X`:
|
||||
error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:
|
||||
--> $DIR/conflict-with-std.rs:19:1
|
||||
|
|
||||
LL | impl TryFrom<X> for X {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `LolFrom<&[_]>` for type `LocalType<_>`:
|
||||
error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`:
|
||||
--> $DIR/issue-23563.rs:13:1
|
||||
|
|
||||
LL | impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Into<_>` for type `GenX<_>`:
|
||||
error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`:
|
||||
--> $DIR/issue-27403.rs:5:1
|
||||
|
|
||||
LL | impl<S> Into<S> for GenX<S> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Deref` for type `&_`:
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`:
|
||||
--> $DIR/issue-28981.rs:5:1
|
||||
|
|
||||
LL | impl<Foo> Deref for Foo { }
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `From<MyError<_>>` for type `MyError<_>`:
|
||||
error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`:
|
||||
--> $DIR/so-37347311.rs:11:1
|
||||
|
|
||||
LL | impl<S: Storage> From<S::Error> for MyError<S> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Drop` for type `MyStruct`:
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`:
|
||||
--> $DIR/issue-28568.rs:7:1
|
||||
|
|
||||
LL | impl Drop for MyStruct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn Send + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:18:1
|
||||
|
|
||||
LL | impl Trait1 for dyn Send {}
|
||||
| ------------------------ first implementation here
|
||||
LL | impl Trait1 for dyn Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
|
||||
|
||||
error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn Send + 'static)`:
|
||||
error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn std::marker::Send + 'static)`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:25:1
|
||||
|
|
||||
LL | impl Trait2 for dyn Send {}
|
||||
@ -14,21 +14,21 @@ LL | impl Trait2 for dyn Send {}
|
||||
LL | impl !Trait2 for dyn Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait3<(dyn Sync + 'static)>` for type `(dyn Send + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:32:1
|
||||
|
|
||||
LL | impl Trait3<dyn Sync> for dyn Send {}
|
||||
| ---------------------------------- first implementation here
|
||||
LL | impl Trait3<dyn Sync> for dyn Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn Send + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:39:1
|
||||
|
|
||||
LL | impl<T: ?Sized> Trait4a for T {}
|
||||
| ----------------------------- first implementation here
|
||||
LL | impl Trait4a for dyn Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait4b` for type `()`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:46:1
|
||||
@ -38,29 +38,29 @@ LL | impl Trait4b for () {}
|
||||
LL | impl Trait4b for () {}
|
||||
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + Send + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:53:1
|
||||
|
|
||||
LL | impl Trait4c for dyn Trait1 + Send {}
|
||||
| ---------------------------------- first implementation here
|
||||
LL | impl Trait4c for dyn Trait1 + Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + Send + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + std::marker::Send + 'static)`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn Send`:
|
||||
error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:60:1
|
||||
|
|
||||
LL | impl<'a> Trait4d for dyn Send + 'a {}
|
||||
| ---------------------------------- first implementation here
|
||||
LL | impl<'a> Trait4d for dyn Send + 'a {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn std::marker::Send`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn Send + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)`:
|
||||
--> $DIR/issue-33140-hack-boundaries.rs:67:1
|
||||
|
|
||||
LL | impl Trait5 for dyn Send {}
|
||||
| ------------------------ first implementation here
|
||||
LL | impl Trait5 for dyn Send where u32: Copy {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
|
||||
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
|
||||
--> $DIR/issue-33140-traitobject-crate.rs:85:1
|
||||
|
|
||||
LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { }
|
||||
| ------------------------------------------------------ first implementation here
|
||||
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/issue-33140-traitobject-crate.rs:3:9
|
||||
@ -14,26 +14,26 @@ LL | #![warn(order_dependent_trait_objects)]
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
|
||||
|
||||
warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
|
||||
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
|
||||
--> $DIR/issue-33140-traitobject-crate.rs:88:1
|
||||
|
|
||||
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
|
||||
| ------------------------------------------------------------- first implementation here
|
||||
...
|
||||
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
|
||||
|
||||
warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
|
||||
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
|
||||
--> $DIR/issue-33140-traitobject-crate.rs:92:1
|
||||
|
|
||||
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
|
||||
| ------------------------------------------------------ first implementation here
|
||||
...
|
||||
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
|
||||
|
@ -1,20 +1,20 @@
|
||||
error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`:
|
||||
--> $DIR/issue-33140.rs:9:1
|
||||
|
|
||||
LL | impl Trait for dyn Send + Sync {
|
||||
| ------------------------------ first implementation here
|
||||
...
|
||||
LL | impl Trait for dyn Sync + Send {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn Send + Sync + 'static)`:
|
||||
error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`:
|
||||
--> $DIR/issue-33140.rs:22:1
|
||||
|
|
||||
LL | impl Trait2 for dyn Send + Sync {
|
||||
| ------------------------------- first implementation here
|
||||
...
|
||||
LL | impl Trait2 for dyn Sync + Send + Sync {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
||||
error[E0592]: duplicate definitions with name `abc`
|
||||
--> $DIR/issue-33140.rs:29:5
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Drop` for type `Box<_>`:
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_>`:
|
||||
--> $DIR/issue-41974.rs:7:1
|
||||
|
|
||||
LL | impl<T> Drop for T where T: A {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Trait1<Box<_>>` for type `A`:
|
||||
error[E0119]: conflicting implementations of trait `Trait1<std::boxed::Box<_>>` for type `A`:
|
||||
--> $DIR/issue-43355.rs:13:1
|
||||
|
|
||||
LL | impl<X, T> Trait1<X> for T where T: Trait2<X> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Regression test for #48728, an ICE that occurred computing
|
||||
// coherence "help" information.
|
||||
|
||||
#[derive(Clone)] //~ ERROR conflicting implementations of trait `Clone`
|
||||
#[derive(Clone)] //~ ERROR conflicting implementations of trait `std::clone::Clone`
|
||||
struct Node<T: ?Sized>(Box<T>);
|
||||
|
||||
impl<T: Clone + ?Sized> Clone for Node<[T]> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Clone` for type `Node<[_]>`:
|
||||
error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Node<[_]>`:
|
||||
--> $DIR/issue-48728.rs:4:10
|
||||
|
|
||||
LL | #[derive(Clone)]
|
||||
|
@ -1,36 +1,36 @@
|
||||
error: conflicting implementations of trait `Foo` for type `(dyn Send + 'static)`: (E0119)
|
||||
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + 'static)`: (E0119)
|
||||
--> $DIR/lint-incoherent-auto-trait-objects.rs:5:1
|
||||
|
|
||||
LL | impl Foo for dyn Send {}
|
||||
| --------------------- first implementation here
|
||||
LL |
|
||||
LL | impl Foo for dyn Send + Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
|
||||
|
|
||||
= note: `#[deny(order_dependent_trait_objects)]` on by default
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
|
||||
|
||||
error: conflicting implementations of trait `Foo` for type `(dyn Send + Sync + 'static)`: (E0119)
|
||||
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
|
||||
--> $DIR/lint-incoherent-auto-trait-objects.rs:11:1
|
||||
|
|
||||
LL | impl Foo for dyn Send + Sync {}
|
||||
| ---------------------------- first implementation here
|
||||
LL |
|
||||
LL | impl Foo for dyn Sync + Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
|
||||
|
||||
error: conflicting implementations of trait `Foo` for type `(dyn Send + Sync + 'static)`: (E0119)
|
||||
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
|
||||
--> $DIR/lint-incoherent-auto-trait-objects.rs:15:1
|
||||
|
|
||||
LL | impl Foo for dyn Sync + Send {}
|
||||
| ---------------------------- first implementation here
|
||||
...
|
||||
LL | impl Foo for dyn Send + Sync + Send {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Add` for type `i32`:
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Add` for type `i32`:
|
||||
--> $DIR/const-and-non-const-impl.rs:6:1
|
||||
|
|
||||
LL | impl const std::ops::Add for i32 {
|
||||
@ -7,7 +7,7 @@ LL | impl const std::ops::Add for i32 {
|
||||
= note: conflicting implementation in crate `core`:
|
||||
- impl Add for i32;
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Add` for type `Int`:
|
||||
error[E0119]: conflicting implementations of trait `std::ops::Add` for type `Int`:
|
||||
--> $DIR/const-and-non-const-impl.rs:24:1
|
||||
|
|
||||
LL | impl std::ops::Add for Int {
|
||||
|
@ -7,7 +7,7 @@ LL | #![feature(specialization)]
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
|
||||
|
||||
error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
|
||||
error[E0751]: found both positive and negative implementation of trait `std::marker::Send` for type `TestType<_>`:
|
||||
--> $DIR/specialization-overlap-negative.rs:9:1
|
||||
|
|
||||
LL | unsafe impl<T: Clone> Send for TestType<T> {}
|
||||
|
@ -7,13 +7,13 @@ LL | #![feature(specialization)]
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Foo` for type `Vec<_>`:
|
||||
error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>`:
|
||||
--> $DIR/specialization-overlap.rs:5:1
|
||||
|
|
||||
LL | impl<T: Clone> Foo for T {}
|
||||
| ------------------------ first implementation here
|
||||
LL | impl<T> Foo for Vec<T> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Vec<_>`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::vec::Vec<_>`
|
||||
|
||||
error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`:
|
||||
--> $DIR/specialization-overlap.rs:9:1
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0751]: found both positive and negative implementation of trait `Clone` for type `&mut MyType<'_>`:
|
||||
error[E0751]: found both positive and negative implementation of trait `std::clone::Clone` for type `&mut MyType<'_>`:
|
||||
--> $DIR/pin-unsound-issue-66544-clone.rs:7:1
|
||||
|
|
||||
LL | impl<'a> Clone for &'a mut MyType<'a> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0751]: found both positive and negative implementation of trait `DerefMut` for type `&MyType<'_>`:
|
||||
error[E0751]: found both positive and negative implementation of trait `std::ops::DerefMut` for type `&MyType<'_>`:
|
||||
--> $DIR/pin-unsound-issue-66544-derefmut.rs:12:1
|
||||
|
|
||||
LL | impl<'a> DerefMut for &'a MyType<'a> {
|
||||
|
@ -1,10 +1,10 @@
|
||||
error[E0119]: conflicting implementations of trait `LocalTrait` for type `String`:
|
||||
error[E0119]: conflicting implementations of trait `LocalTrait` for type `std::string::String`:
|
||||
--> $DIR/rely-on-negative-impl-in-coherence.rs:19:1
|
||||
|
|
||||
LL | impl<T: ForeignTrait> LocalTrait for T { }
|
||||
| -------------------------------------- first implementation here
|
||||
LL | impl LocalTrait for String { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `String`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::string::String`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `Send` for type `MyStruct`:
|
||||
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct`:
|
||||
--> $DIR/overlap-not-permitted-for-builtin-trait.rs:7:1
|
||||
|
|
||||
LL | impl !Send for MyStruct {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0119]: conflicting implementations of trait `FnOnce<()>` for type `&_`:
|
||||
error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`:
|
||||
--> $DIR/incoherent-assoc-imp-trait.rs:10:1
|
||||
|
|
||||
LL | impl<F> FnOnce<()> for &F {
|
||||
|
Loading…
Reference in New Issue
Block a user