1
Fork 0

Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwco

Don't print full paths in overlap errors

We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message.

r? diagnostics
This commit is contained in:
Matthias Krüger 2022-11-14 19:26:16 +01:00 committed by GitHub
commit abda584a5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 157 additions and 156 deletions

View file

@ -1254,6 +1254,10 @@ impl HandlerInner {
} }
if diagnostic.has_future_breakage() { if diagnostic.has_future_breakage() {
// Future breakages aren't emitted if they're Level::Allowed,
// but they still need to be constructed and stashed below,
// so they'll trigger the good-path bug check.
self.suppressed_expected_diag = true;
self.future_breakage_diagnostics.push(diagnostic.clone()); self.future_breakage_diagnostics.push(diagnostic.clone());
} }

View file

@ -58,10 +58,10 @@ pub struct NoValueInOnUnimplemented {
pub span: Span, pub span: Span,
} }
pub struct NegativePositiveConflict<'a> { pub struct NegativePositiveConflict<'tcx> {
pub impl_span: Span, pub impl_span: Span,
pub trait_desc: &'a str, pub trait_desc: ty::TraitRef<'tcx>,
pub self_desc: &'a Option<String>, pub self_ty: Option<Ty<'tcx>>,
pub negative_impl_span: Result<Span, Symbol>, pub negative_impl_span: Result<Span, Symbol>,
pub positive_impl_span: Result<Span, Symbol>, pub positive_impl_span: Result<Span, Symbol>,
} }
@ -73,10 +73,10 @@ impl IntoDiagnostic<'_> for NegativePositiveConflict<'_> {
handler: &Handler, handler: &Handler,
) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> { ) -> rustc_errors::DiagnosticBuilder<'_, ErrorGuaranteed> {
let mut diag = handler.struct_err(fluent::trait_selection_negative_positive_conflict); let mut diag = handler.struct_err(fluent::trait_selection_negative_positive_conflict);
diag.set_arg("trait_desc", self.trait_desc); diag.set_arg("trait_desc", self.trait_desc.print_only_trait_path().to_string());
diag.set_arg( diag.set_arg(
"self_desc", "self_desc",
self.self_desc.clone().map_or_else(|| String::from("none"), |ty| ty), self.self_ty.map_or_else(|| "none".to_string(), |ty| ty.to_string()),
); );
diag.set_span(self.impl_span); diag.set_span(self.impl_span);
diag.code(rustc_errors::error_code!(E0751)); diag.code(rustc_errors::error_code!(E0751));

View file

@ -64,13 +64,13 @@ pub fn add_placeholder_note(err: &mut Diagnostic) {
/// with a suitably-freshened `ImplHeader` with those types /// with a suitably-freshened `ImplHeader` with those types
/// substituted. Otherwise, returns `None`. /// substituted. Otherwise, returns `None`.
#[instrument(skip(tcx, skip_leak_check), level = "debug")] #[instrument(skip(tcx, skip_leak_check), level = "debug")]
pub fn overlapping_impls( pub fn overlapping_impls<'tcx>(
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
impl1_def_id: DefId, impl1_def_id: DefId,
impl2_def_id: DefId, impl2_def_id: DefId,
skip_leak_check: SkipLeakCheck, skip_leak_check: SkipLeakCheck,
overlap_mode: OverlapMode, overlap_mode: OverlapMode,
) -> Option<OverlapResult<'_>> { ) -> Option<OverlapResult<'tcx>> {
// Before doing expensive operations like entering an inference context, do // Before doing expensive operations like entering an inference context, do
// a quick check via fast_reject to tell if the impl headers could possibly // a quick check via fast_reject to tell if the impl headers could possibly
// unify. // unify.

View file

@ -19,9 +19,9 @@ use crate::traits::engine::TraitEngineExt as _;
use crate::traits::select::IntercrateAmbiguityCause; use crate::traits::select::IntercrateAmbiguityCause;
use crate::traits::{self, coherence, FutureCompatOverlapErrorKind, ObligationCause}; use crate::traits::{self, coherence, FutureCompatOverlapErrorKind, ObligationCause};
use rustc_data_structures::fx::FxIndexSet; use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::{struct_span_err, DiagnosticBuilder, EmissionGuarantee}; use rustc_errors::{error_code, DelayDm, Diagnostic};
use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_middle::ty::{self, ImplSubject, TyCtxt}; use rustc_middle::ty::{self, ImplSubject, Ty, TyCtxt};
use rustc_middle::ty::{InternalSubsts, SubstsRef}; use rustc_middle::ty::{InternalSubsts, SubstsRef};
use rustc_session::lint::builtin::COHERENCE_LEAK_CHECK; use rustc_session::lint::builtin::COHERENCE_LEAK_CHECK;
use rustc_session::lint::builtin::ORDER_DEPENDENT_TRAIT_OBJECTS; use rustc_session::lint::builtin::ORDER_DEPENDENT_TRAIT_OBJECTS;
@ -32,10 +32,10 @@ use super::SelectionContext;
/// Information pertinent to an overlapping impl error. /// Information pertinent to an overlapping impl error.
#[derive(Debug)] #[derive(Debug)]
pub struct OverlapError { pub struct OverlapError<'tcx> {
pub with_impl: DefId, pub with_impl: DefId,
pub trait_desc: String, pub trait_ref: ty::TraitRef<'tcx>,
pub self_desc: Option<String>, pub self_ty: Option<Ty<'tcx>>,
pub intercrate_ambiguity_causes: FxIndexSet<IntercrateAmbiguityCause>, pub intercrate_ambiguity_causes: FxIndexSet<IntercrateAmbiguityCause>,
pub involves_placeholder: bool, pub involves_placeholder: bool,
} }
@ -275,9 +275,9 @@ pub(super) fn specialization_graph_provider(
// it negatively impacts perf. // it negatively impacts perf.
#[cold] #[cold]
#[inline(never)] #[inline(never)]
fn report_overlap_conflict( fn report_overlap_conflict<'tcx>(
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
overlap: OverlapError, overlap: OverlapError<'tcx>,
impl_def_id: LocalDefId, impl_def_id: LocalDefId,
used_to_be_allowed: Option<FutureCompatOverlapErrorKind>, used_to_be_allowed: Option<FutureCompatOverlapErrorKind>,
sg: &mut specialization_graph::Graph, sg: &mut specialization_graph::Graph,
@ -313,9 +313,9 @@ fn report_overlap_conflict(
} }
} }
fn report_negative_positive_conflict( fn report_negative_positive_conflict<'tcx>(
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
overlap: &OverlapError, overlap: &OverlapError<'tcx>,
local_impl_def_id: LocalDefId, local_impl_def_id: LocalDefId,
negative_impl_def_id: DefId, negative_impl_def_id: DefId,
positive_impl_def_id: DefId, positive_impl_def_id: DefId,
@ -323,17 +323,17 @@ fn report_negative_positive_conflict(
) { ) {
let mut err = tcx.sess.create_err(NegativePositiveConflict { let mut err = tcx.sess.create_err(NegativePositiveConflict {
impl_span: tcx.def_span(local_impl_def_id), impl_span: tcx.def_span(local_impl_def_id),
trait_desc: &overlap.trait_desc, trait_desc: overlap.trait_ref,
self_desc: &overlap.self_desc, self_ty: overlap.self_ty,
negative_impl_span: tcx.span_of_impl(negative_impl_def_id), negative_impl_span: tcx.span_of_impl(negative_impl_def_id),
positive_impl_span: tcx.span_of_impl(positive_impl_def_id), positive_impl_span: tcx.span_of_impl(positive_impl_def_id),
}); });
sg.has_errored = Some(err.emit()); sg.has_errored = Some(err.emit());
} }
fn report_conflicting_impls( fn report_conflicting_impls<'tcx>(
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
overlap: OverlapError, overlap: OverlapError<'tcx>,
impl_def_id: LocalDefId, impl_def_id: LocalDefId,
used_to_be_allowed: Option<FutureCompatOverlapErrorKind>, used_to_be_allowed: Option<FutureCompatOverlapErrorKind>,
sg: &mut specialization_graph::Graph, sg: &mut specialization_graph::Graph,
@ -343,12 +343,12 @@ fn report_conflicting_impls(
// Work to be done after we've built the DiagnosticBuilder. We have to define it // Work to be done after we've built the DiagnosticBuilder. We have to define it
// now because the struct_lint methods don't return back the DiagnosticBuilder // now because the struct_lint methods don't return back the DiagnosticBuilder
// that's passed in. // that's passed in.
fn decorate<'a, 'b, G: EmissionGuarantee>( fn decorate<'tcx>(
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
overlap: OverlapError, overlap: &OverlapError<'tcx>,
impl_span: Span, impl_span: Span,
err: &'b mut DiagnosticBuilder<'a, G>, err: &mut Diagnostic,
) -> &'b mut DiagnosticBuilder<'a, G> { ) {
match tcx.span_of_impl(overlap.with_impl) { match tcx.span_of_impl(overlap.with_impl) {
Ok(span) => { Ok(span) => {
err.span_label(span, "first implementation here"); err.span_label(span, "first implementation here");
@ -357,7 +357,7 @@ fn report_conflicting_impls(
impl_span, impl_span,
format!( format!(
"conflicting implementation{}", "conflicting implementation{}",
overlap.self_desc.map_or_else(String::new, |ty| format!(" for `{}`", ty)) overlap.self_ty.map_or_else(String::new, |ty| format!(" for `{}`", ty))
), ),
); );
} }
@ -379,26 +379,28 @@ fn report_conflicting_impls(
if overlap.involves_placeholder { if overlap.involves_placeholder {
coherence::add_placeholder_note(err); coherence::add_placeholder_note(err);
} }
err
} }
let msg = format!( let msg = DelayDm(|| {
"conflicting implementations of trait `{}`{}{}", format!(
overlap.trait_desc, "conflicting implementations of trait `{}`{}{}",
overlap.self_desc.as_deref().map_or_else(String::new, |ty| format!(" for type `{ty}`")), overlap.trait_ref.print_only_trait_path(),
match used_to_be_allowed { overlap.self_ty.map_or_else(String::new, |ty| format!(" for type `{ty}`")),
Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)", match used_to_be_allowed {
_ => "", Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)",
} _ => "",
); }
)
});
match used_to_be_allowed { match used_to_be_allowed {
None => { None => {
let reported = if overlap.with_impl.is_local() let reported = if overlap.with_impl.is_local()
|| tcx.orphan_check_impl(impl_def_id).is_ok() || tcx.orphan_check_impl(impl_def_id).is_ok()
{ {
let mut err = struct_span_err!(tcx.sess, impl_span, E0119, "{msg}",); let mut err = tcx.sess.struct_span_err(impl_span, msg);
decorate(tcx, overlap, impl_span, &mut err); err.code(error_code!(E0119));
decorate(tcx, &overlap, impl_span, &mut err);
Some(err.emit()) Some(err.emit())
} else { } else {
Some(tcx.sess.delay_span_bug(impl_span, "impl should have failed the orphan check")) Some(tcx.sess.delay_span_bug(impl_span, "impl should have failed the orphan check"))
@ -415,7 +417,10 @@ fn report_conflicting_impls(
tcx.hir().local_def_id_to_hir_id(impl_def_id), tcx.hir().local_def_id_to_hir_id(impl_def_id),
impl_span, impl_span,
msg, msg,
|err| decorate(tcx, overlap, impl_span, err), |err| {
decorate(tcx, &overlap, impl_span, err);
err
},
); );
} }
}; };

View file

@ -3,7 +3,6 @@ use super::OverlapError;
use crate::traits; use crate::traits;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_middle::ty::fast_reject::{self, SimplifiedType, TreatParams}; use rustc_middle::ty::fast_reject::{self, SimplifiedType, TreatParams};
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{self, TyCtxt, TypeVisitable}; use rustc_middle::ty::{self, TyCtxt, TypeVisitable};
pub use rustc_middle::traits::specialization_graph::*; pub use rustc_middle::traits::specialization_graph::*;
@ -15,15 +14,15 @@ pub enum FutureCompatOverlapErrorKind {
} }
#[derive(Debug)] #[derive(Debug)]
pub struct FutureCompatOverlapError { pub struct FutureCompatOverlapError<'tcx> {
pub error: OverlapError, pub error: OverlapError<'tcx>,
pub kind: FutureCompatOverlapErrorKind, pub kind: FutureCompatOverlapErrorKind,
} }
/// The result of attempting to insert an impl into a group of children. /// The result of attempting to insert an impl into a group of children.
enum Inserted { enum Inserted<'tcx> {
/// The impl was inserted as a new child in this group of children. /// The impl was inserted as a new child in this group of children.
BecameNewSibling(Option<FutureCompatOverlapError>), BecameNewSibling(Option<FutureCompatOverlapError<'tcx>>),
/// The impl should replace existing impls [X1, ..], because the impl specializes X1, X2, etc. /// The impl should replace existing impls [X1, ..], because the impl specializes X1, X2, etc.
ReplaceChildren(Vec<DefId>), ReplaceChildren(Vec<DefId>),
@ -42,12 +41,12 @@ trait ChildrenExt<'tcx> {
impl_def_id: DefId, impl_def_id: DefId,
simplified_self: Option<SimplifiedType>, simplified_self: Option<SimplifiedType>,
overlap_mode: OverlapMode, overlap_mode: OverlapMode,
) -> Result<Inserted, OverlapError>; ) -> Result<Inserted<'tcx>, OverlapError<'tcx>>;
} }
impl ChildrenExt<'_> for Children { impl<'tcx> ChildrenExt<'tcx> for Children {
/// Insert an impl into this set of children without comparing to any existing impls. /// Insert an impl into this set of children without comparing to any existing impls.
fn insert_blindly(&mut self, tcx: TyCtxt<'_>, impl_def_id: DefId) { fn insert_blindly(&mut self, tcx: TyCtxt<'tcx>, impl_def_id: DefId) {
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap(); let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer) if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer)
{ {
@ -62,7 +61,7 @@ impl ChildrenExt<'_> for Children {
/// Removes an impl from this set of children. Used when replacing /// Removes an impl from this set of children. Used when replacing
/// an impl with a parent. The impl must be present in the list of /// an impl with a parent. The impl must be present in the list of
/// children already. /// children already.
fn remove_existing(&mut self, tcx: TyCtxt<'_>, impl_def_id: DefId) { fn remove_existing(&mut self, tcx: TyCtxt<'tcx>, impl_def_id: DefId) {
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap(); let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
let vec: &mut Vec<DefId>; let vec: &mut Vec<DefId>;
if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer) if let Some(st) = fast_reject::simplify_type(tcx, trait_ref.self_ty(), TreatParams::AsInfer)
@ -82,11 +81,11 @@ impl ChildrenExt<'_> for Children {
/// specialization relationships. /// specialization relationships.
fn insert( fn insert(
&mut self, &mut self,
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
impl_def_id: DefId, impl_def_id: DefId,
simplified_self: Option<SimplifiedType>, simplified_self: Option<SimplifiedType>,
overlap_mode: OverlapMode, overlap_mode: OverlapMode,
) -> Result<Inserted, OverlapError> { ) -> Result<Inserted<'tcx>, OverlapError<'tcx>> {
let mut last_lint = None; let mut last_lint = None;
let mut replace_children = Vec::new(); let mut replace_children = Vec::new();
@ -103,30 +102,23 @@ impl ChildrenExt<'_> for Children {
impl_def_id, simplified_self, possible_sibling, impl_def_id, simplified_self, possible_sibling,
); );
let create_overlap_error = |overlap: traits::coherence::OverlapResult<'_>| { let create_overlap_error = |overlap: traits::coherence::OverlapResult<'tcx>| {
let trait_ref = overlap.impl_header.trait_ref.unwrap(); let trait_ref = overlap.impl_header.trait_ref.unwrap();
let self_ty = trait_ref.self_ty(); let self_ty = trait_ref.self_ty();
// FIXME: should postpone string formatting until we decide to actually emit. OverlapError {
with_no_trimmed_paths!({ with_impl: possible_sibling,
OverlapError { trait_ref,
with_impl: possible_sibling, // Only report the `Self` type if it has at least
trait_desc: trait_ref.print_only_trait_path().to_string(), // some outer concrete shell; otherwise, it's
// Only report the `Self` type if it has at least // not adding much information.
// some outer concrete shell; otherwise, it's self_ty: if self_ty.has_concrete_skeleton() { Some(self_ty) } else { None },
// not adding much information. intercrate_ambiguity_causes: overlap.intercrate_ambiguity_causes,
self_desc: if self_ty.has_concrete_skeleton() { involves_placeholder: overlap.involves_placeholder,
Some(self_ty.to_string()) }
} else {
None
},
intercrate_ambiguity_causes: overlap.intercrate_ambiguity_causes,
involves_placeholder: overlap.involves_placeholder,
}
})
}; };
let report_overlap_error = |overlap: traits::coherence::OverlapResult<'_>, let report_overlap_error = |overlap: traits::coherence::OverlapResult<'tcx>,
last_lint: &mut _| { last_lint: &mut _| {
// Found overlap, but no specialization; error out or report future-compat warning. // Found overlap, but no specialization; error out or report future-compat warning.
@ -255,31 +247,31 @@ where
} }
} }
pub trait GraphExt { pub trait GraphExt<'tcx> {
/// Insert a local impl into the specialization graph. If an existing impl /// Insert a local impl into the specialization graph. If an existing impl
/// conflicts with it (has overlap, but neither specializes the other), /// conflicts with it (has overlap, but neither specializes the other),
/// information about the area of overlap is returned in the `Err`. /// information about the area of overlap is returned in the `Err`.
fn insert( fn insert(
&mut self, &mut self,
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
impl_def_id: DefId, impl_def_id: DefId,
overlap_mode: OverlapMode, overlap_mode: OverlapMode,
) -> Result<Option<FutureCompatOverlapError>, OverlapError>; ) -> Result<Option<FutureCompatOverlapError<'tcx>>, OverlapError<'tcx>>;
/// Insert cached metadata mapping from a child impl back to its parent. /// Insert cached metadata mapping from a child impl back to its parent.
fn record_impl_from_cstore(&mut self, tcx: TyCtxt<'_>, parent: DefId, child: DefId); fn record_impl_from_cstore(&mut self, tcx: TyCtxt<'tcx>, parent: DefId, child: DefId);
} }
impl GraphExt for Graph { impl<'tcx> GraphExt<'tcx> for Graph {
/// Insert a local impl into the specialization graph. If an existing impl /// Insert a local impl into the specialization graph. If an existing impl
/// conflicts with it (has overlap, but neither specializes the other), /// conflicts with it (has overlap, but neither specializes the other),
/// information about the area of overlap is returned in the `Err`. /// information about the area of overlap is returned in the `Err`.
fn insert( fn insert(
&mut self, &mut self,
tcx: TyCtxt<'_>, tcx: TyCtxt<'tcx>,
impl_def_id: DefId, impl_def_id: DefId,
overlap_mode: OverlapMode, overlap_mode: OverlapMode,
) -> Result<Option<FutureCompatOverlapError>, OverlapError> { ) -> Result<Option<FutureCompatOverlapError<'tcx>>, OverlapError<'tcx>> {
assert!(impl_def_id.is_local()); assert!(impl_def_id.is_local());
let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap(); let trait_ref = tcx.impl_trait_ref(impl_def_id).unwrap();
@ -376,7 +368,7 @@ impl GraphExt for Graph {
} }
/// Insert cached metadata mapping from a child impl back to its parent. /// Insert cached metadata mapping from a child impl back to its parent.
fn record_impl_from_cstore(&mut self, tcx: TyCtxt<'_>, parent: DefId, child: DefId) { fn record_impl_from_cstore(&mut self, tcx: TyCtxt<'tcx>, parent: DefId, child: DefId) {
if self.parent.insert(child, parent).is_some() { if self.parent.insert(child, parent).is_some() {
bug!( bug!(
"When recording an impl from the crate store, information about its parent \ "When recording an impl from the crate store, information about its parent \

View file

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

View file

@ -1,4 +1,4 @@
error[E0751]: found both positive and negative implementation of trait `std::marker::Send` for type `TestType<_>`: error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
--> $DIR/coherence-conflicting-negative-trait-impl.rs:11:1 --> $DIR/coherence-conflicting-negative-trait-impl.rs:11:1
| |
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
@ -7,7 +7,7 @@ LL |
LL | impl<T: MyTrait> !Send for TestType<T> {} LL | impl<T: MyTrait> !Send for TestType<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>` error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>`
--> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1 --> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1
| |
LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {} LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}

View file

@ -9,7 +9,7 @@ LL | impl Copy for i32 {}
| |
= note: define and implement a trait or new type instead = note: define and implement a trait or new type instead
error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync` error[E0119]: conflicting implementations of trait `Copy` for type `&NotSync`
--> $DIR/coherence-impls-copy.rs:28:1 --> $DIR/coherence-impls-copy.rs:28:1
| |
LL | impl Copy for &'static NotSync {} LL | impl Copy for &'static NotSync {}

View file

@ -1,10 +1,10 @@
error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>` error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>`
--> $DIR/coherence-overlap-issue-23516.rs:8:1 --> $DIR/coherence-overlap-issue-23516.rs:8:1
| |
LL | impl<T:Sugar> Sweet for T { } LL | impl<T:Sugar> Sweet for T { }
| ------------------------- first implementation here | ------------------------- first implementation here
LL | impl<U:Sugar> Sweet for Box<U> { } LL | impl<U:Sugar> Sweet for Box<U> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::boxed::Box<_>` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Box<_>`
| |
= note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>` = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>`

View file

@ -1,11 +1,11 @@
error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>` error[E0119]: conflicting implementations of trait `Foo<_>` for type `Option<_>`
--> $DIR/coherence-projection-conflict-ty-param.rs:10:1 --> $DIR/coherence-projection-conflict-ty-param.rs:10:1
| |
LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {} LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
| ---------------------------------------- first implementation here | ---------------------------------------- first implementation here
LL | LL |
LL | impl<T, U> Foo<T> for Option<U> { } LL | impl<T, U> Foo<T> for Option<U> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Option<_>`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,11 +1,11 @@
error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _` error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn Fn(&_) -> _`
--> $DIR/coherence-wasm-bindgen.rs:28:1 --> $DIR/coherence-wasm-bindgen.rs:28:1
| |
LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
| ------------------------------------------------------------ first implementation here | ------------------------------------------------------------ first implementation here
... ...
LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b) LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&dyn Fn(&_) -> _`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = 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 #56105 <https://github.com/rust-lang/rust/issues/56105> = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>

View file

@ -1,11 +1,11 @@
error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>` error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFundamentalStruct<(MyType,)>`
--> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1 --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1
| |
LL | impl<T: lib::MyCopy> MyTrait for T { } LL | impl<T: lib::MyCopy> MyTrait for T { }
| ---------------------------------- first implementation here | ---------------------------------- first implementation here
... ...
LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFundamentalStruct<(MyType,)>`
| |
= note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions = note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions

View file

@ -1,11 +1,11 @@
error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>` error[E0119]: conflicting implementations of trait `MyTrait` for type `MyStruct<MyType>`
--> $DIR/coherence_copy_like_err_struct.rs:19:1 --> $DIR/coherence_copy_like_err_struct.rs:19:1
| |
LL | impl<T: lib::MyCopy> MyTrait for T { } LL | impl<T: lib::MyCopy> MyTrait for T { }
| ---------------------------------- first implementation here | ---------------------------------- first implementation here
... ...
LL | impl MyTrait for lib::MyStruct<MyType> { } LL | impl MyTrait for lib::MyStruct<MyType> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct<MyType>`
| |
= note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions = note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions

View file

@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `std::convert::From<()>` for type `S` error[E0119]: conflicting implementations of trait `From<()>` for type `S`
--> $DIR/inter-crate-ambiguity-causes-notes.rs:9:1 --> $DIR/inter-crate-ambiguity-causes-notes.rs:9:1
| |
LL | impl From<()> for S { LL | impl From<()> for S {

View file

@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>` error[E0119]: conflicting implementations of trait `AsRef<Q>` for type `Box<Q>`
--> $DIR/conflict-with-std.rs:5:1 --> $DIR/conflict-with-std.rs:5:1
| |
LL | impl AsRef<Q> for Box<Q> { LL | impl AsRef<Q> for Box<Q> {
@ -8,7 +8,7 @@ LL | impl AsRef<Q> for Box<Q> {
- impl<T, A> AsRef<T> for Box<T, A> - impl<T, A> AsRef<T> for Box<T, A>
where A: Allocator, T: ?Sized; where A: Allocator, T: ?Sized;
error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S` error[E0119]: conflicting implementations of trait `From<S>` for type `S`
--> $DIR/conflict-with-std.rs:12:1 --> $DIR/conflict-with-std.rs:12:1
| |
LL | impl From<S> for S { LL | impl From<S> for S {
@ -17,7 +17,7 @@ LL | impl From<S> for S {
= note: conflicting implementation in crate `core`: = note: conflicting implementation in crate `core`:
- impl<T> From<T> for T; - impl<T> From<T> for T;
error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X` error[E0119]: conflicting implementations of trait `TryFrom<X>` for type `X`
--> $DIR/conflict-with-std.rs:19:1 --> $DIR/conflict-with-std.rs:19:1
| |
LL | impl TryFrom<X> for X { LL | impl TryFrom<X> for X {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
// Regression test for #48728, an ICE that occurred computing // Regression test for #48728, an ICE that occurred computing
// coherence "help" information. // coherence "help" information.
#[derive(Clone)] //~ ERROR conflicting implementations of trait `std::clone::Clone` #[derive(Clone)] //~ ERROR conflicting implementations of trait `Clone`
struct Node<T: ?Sized>(Box<T>); struct Node<T: ?Sized>(Box<T>);
impl<T: Clone + ?Sized> Clone for Node<[T]> { impl<T: Clone + ?Sized> Clone for Node<[T]> {

View file

@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Node<[_]>` error[E0119]: conflicting implementations of trait `Clone` for type `Node<[_]>`
--> $DIR/issue-48728.rs:4:10 --> $DIR/issue-48728.rs:4:10
| |
LL | #[derive(Clone)] LL | #[derive(Clone)]

View file

@ -1,36 +1,36 @@
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + 'static)`: (E0119) error: conflicting implementations of trait `Foo` for type `(dyn Send + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:5:1 --> $DIR/lint-incoherent-auto-trait-objects.rs:5:1
| |
LL | impl Foo for dyn Send {} LL | impl Foo for dyn Send {}
| --------------------- first implementation here | --------------------- first implementation here
LL | LL |
LL | impl Foo for dyn Send + Send {} LL | impl Foo for dyn Send + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
= note: `#[deny(order_dependent_trait_objects)]` on by default = note: `#[deny(order_dependent_trait_objects)]` on by default
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) error: conflicting implementations of trait `Foo` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:11:1 --> $DIR/lint-incoherent-auto-trait-objects.rs:11:1
| |
LL | impl Foo for dyn Send + Sync {} LL | impl Foo for dyn Send + Sync {}
| ---------------------------- first implementation here | ---------------------------- first implementation here
LL | LL |
LL | impl Foo for dyn Sync + Send {} LL | impl Foo for dyn Sync + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) error: conflicting implementations of trait `Foo` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:15:1 --> $DIR/lint-incoherent-auto-trait-objects.rs:15:1
| |
LL | impl Foo for dyn Sync + Send {} LL | impl Foo for dyn Sync + Send {}
| ---------------------------- first implementation here | ---------------------------- first implementation here
... ...
LL | impl Foo for dyn Send + Sync + Send {} LL | impl Foo for dyn Send + Sync + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
@ -38,42 +38,42 @@ LL | impl Foo for dyn Send + Sync + Send {}
error: aborting due to 3 previous errors error: aborting due to 3 previous errors
Future incompatibility report: Future breakage diagnostic: Future incompatibility report: Future breakage diagnostic:
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + 'static)`: (E0119) error: conflicting implementations of trait `Foo` for type `(dyn Send + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:5:1 --> $DIR/lint-incoherent-auto-trait-objects.rs:5:1
| |
LL | impl Foo for dyn Send {} LL | impl Foo for dyn Send {}
| --------------------- first implementation here | --------------------- first implementation here
LL | LL |
LL | impl Foo for dyn Send + Send {} LL | impl Foo for dyn Send + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
= note: `#[deny(order_dependent_trait_objects)]` on by default = note: `#[deny(order_dependent_trait_objects)]` on by default
Future breakage diagnostic: Future breakage diagnostic:
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) error: conflicting implementations of trait `Foo` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:11:1 --> $DIR/lint-incoherent-auto-trait-objects.rs:11:1
| |
LL | impl Foo for dyn Send + Sync {} LL | impl Foo for dyn Send + Sync {}
| ---------------------------- first implementation here | ---------------------------- first implementation here
LL | LL |
LL | impl Foo for dyn Sync + Send {} LL | impl Foo for dyn Sync + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
= note: `#[deny(order_dependent_trait_objects)]` on by default = note: `#[deny(order_dependent_trait_objects)]` on by default
Future breakage diagnostic: Future breakage diagnostic:
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) error: conflicting implementations of trait `Foo` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:15:1 --> $DIR/lint-incoherent-auto-trait-objects.rs:15:1
| |
LL | impl Foo for dyn Sync + Send {} LL | impl Foo for dyn Sync + Send {}
| ---------------------------- first implementation here | ---------------------------- first implementation here
... ...
LL | impl Foo for dyn Send + Sync + Send {} LL | impl Foo for dyn Send + Sync + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>

View file

@ -10,7 +10,7 @@ LL | impl const std::ops::Add for i32 {
| |
= note: define and implement a trait or new type instead = note: define and implement a trait or new type instead
error[E0119]: conflicting implementations of trait `std::ops::Add` for type `Int` error[E0119]: conflicting implementations of trait `Add` for type `Int`
--> $DIR/const-and-non-const-impl.rs:22:1 --> $DIR/const-and-non-const-impl.rs:22:1
| |
LL | impl std::ops::Add for Int { LL | impl std::ops::Add for Int {

View file

@ -8,7 +8,7 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete = help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
error[E0751]: found both positive and negative implementation of trait `std::marker::Send` for type `TestType<_>`: error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
--> $DIR/specialization-overlap-negative.rs:9:1 --> $DIR/specialization-overlap-negative.rs:9:1
| |
LL | unsafe impl<T: Clone> Send for TestType<T> {} LL | unsafe impl<T: Clone> Send for TestType<T> {}

View file

@ -8,13 +8,13 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete = help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>` error[E0119]: conflicting implementations of trait `Foo` for type `Vec<_>`
--> $DIR/specialization-overlap.rs:5:1 --> $DIR/specialization-overlap.rs:5:1
| |
LL | impl<T: Clone> Foo for T {} LL | impl<T: Clone> Foo for T {}
| ------------------------ first implementation here | ------------------------ first implementation here
LL | impl<T> Foo for Vec<T> {} LL | impl<T> Foo for Vec<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::vec::Vec<_>` | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Vec<_>`
error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)` error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`
--> $DIR/specialization-overlap.rs:9:1 --> $DIR/specialization-overlap.rs:9:1

View file

@ -1,12 +1,12 @@
error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)` error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn Send + 'static)`
--> $DIR/issue-33140-hack-boundaries.rs:18:1 --> $DIR/issue-33140-hack-boundaries.rs:18:1
| |
LL | impl Trait1 for dyn Send {} LL | impl Trait1 for dyn Send {}
| ------------------------ first implementation here | ------------------------ first implementation here
LL | impl Trait1 for dyn Send {} LL | impl Trait1 for dyn Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn std::marker::Send + 'static)`: error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn Send + 'static)`:
--> $DIR/issue-33140-hack-boundaries.rs:25:1 --> $DIR/issue-33140-hack-boundaries.rs:25:1
| |
LL | impl Trait2 for dyn Send {} LL | impl Trait2 for dyn Send {}
@ -14,21 +14,21 @@ LL | impl Trait2 for dyn Send {}
LL | impl !Trait2 for dyn Send {} LL | impl !Trait2 for dyn Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here | ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)` error[E0119]: conflicting implementations of trait `Trait3<(dyn Sync + 'static)>` for type `(dyn Send + 'static)`
--> $DIR/issue-33140-hack-boundaries.rs:32:1 --> $DIR/issue-33140-hack-boundaries.rs:32:1
| |
LL | impl Trait3<dyn Sync> for dyn Send {} LL | impl Trait3<dyn Sync> for dyn Send {}
| ---------------------------------- first implementation here | ---------------------------------- first implementation here
LL | impl Trait3<dyn Sync> for dyn Send {} LL | impl Trait3<dyn Sync> for dyn Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)` error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn Send + 'static)`
--> $DIR/issue-33140-hack-boundaries.rs:39:1 --> $DIR/issue-33140-hack-boundaries.rs:39:1
| |
LL | impl<T: ?Sized> Trait4a for T {} LL | impl<T: ?Sized> Trait4a for T {}
| ----------------------------- first implementation here | ----------------------------- first implementation here
LL | impl Trait4a for dyn Send {} LL | impl Trait4a for dyn Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
error[E0119]: conflicting implementations of trait `Trait4b` for type `()` error[E0119]: conflicting implementations of trait `Trait4b` for type `()`
--> $DIR/issue-33140-hack-boundaries.rs:46:1 --> $DIR/issue-33140-hack-boundaries.rs:46:1
@ -38,42 +38,42 @@ LL | impl Trait4b for () {}
LL | impl Trait4b for () {} LL | impl Trait4b for () {}
| ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()` | ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)` error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + Send + 'static)`
--> $DIR/issue-33140-hack-boundaries.rs:53:1 --> $DIR/issue-33140-hack-boundaries.rs:53:1
| |
LL | impl Trait4c for dyn Trait1 + Send {} LL | impl Trait4c for dyn Trait1 + Send {}
| ---------------------------------- first implementation here | ---------------------------------- first implementation here
LL | impl Trait4c for dyn Trait1 + Send {} LL | impl Trait4c for dyn Trait1 + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + Send + 'static)`
error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send` error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn Send`
--> $DIR/issue-33140-hack-boundaries.rs:60:1 --> $DIR/issue-33140-hack-boundaries.rs:60:1
| |
LL | impl<'a> Trait4d for dyn Send + 'a {} LL | impl<'a> Trait4d for dyn Send + 'a {}
| ---------------------------------- first implementation here | ---------------------------------- first implementation here
LL | impl<'a> Trait4d for dyn Send + 'a {} LL | impl<'a> Trait4d for dyn Send + 'a {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn std::marker::Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send`
error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)` error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn Send + 'static)`
--> $DIR/issue-33140-hack-boundaries.rs:67:1 --> $DIR/issue-33140-hack-boundaries.rs:67:1
| |
LL | impl Trait5 for dyn Send {} LL | impl Trait5 for dyn Send {}
| ------------------------ first implementation here | ------------------------ first implementation here
LL | impl Trait5 for dyn Send where u32: Copy {} LL | impl Trait5 for dyn Send where u32: Copy {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
error: aborting due to 8 previous errors error: aborting due to 8 previous errors
Some errors have detailed explanations: E0119, E0751. Some errors have detailed explanations: E0119, E0751.
For more information about an error, try `rustc --explain E0119`. For more information about an error, try `rustc --explain E0119`.
Future incompatibility report: Future breakage diagnostic: Future incompatibility report: Future breakage diagnostic:
warning: conflicting implementations of trait `Trait0` for type `(dyn std::marker::Send + 'static)`: (E0119) warning: conflicting implementations of trait `Trait0` for type `(dyn Send + 'static)`: (E0119)
--> $DIR/issue-33140-hack-boundaries.rs:10:1 --> $DIR/issue-33140-hack-boundaries.rs:10:1
| |
LL | impl Trait0 for dyn Send {} LL | impl Trait0 for dyn Send {}
| ------------------------ first implementation here | ------------------------ first implementation here
LL | impl Trait0 for dyn Send {} LL | impl Trait0 for dyn Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)`
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>

View file

@ -1,20 +1,20 @@
error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)` error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`
--> $DIR/issue-33140.rs:9:1 --> $DIR/issue-33140.rs:9:1
| |
LL | impl Trait for dyn Send + Sync { LL | impl Trait for dyn Send + Sync {
| ------------------------------ first implementation here | ------------------------------ first implementation here
... ...
LL | impl Trait for dyn Sync + Send { LL | impl Trait for dyn Sync + Send {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)` error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn Send + Sync + 'static)`
--> $DIR/issue-33140.rs:22:1 --> $DIR/issue-33140.rs:22:1
| |
LL | impl Trait2 for dyn Send + Sync { LL | impl Trait2 for dyn Send + Sync {
| ------------------------------- first implementation here | ------------------------------- first implementation here
... ...
LL | impl Trait2 for dyn Sync + Send + Sync { LL | impl Trait2 for dyn Sync + Send + Sync {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)`
error[E0592]: duplicate definitions with name `abc` error[E0592]: duplicate definitions with name `abc`
--> $DIR/issue-33140.rs:29:5 --> $DIR/issue-33140.rs:29:5

View file

@ -1,4 +1,4 @@
error[E0751]: found both positive and negative implementation of trait `std::clone::Clone` for type `&mut MyType<'_>`: error[E0751]: found both positive and negative implementation of trait `Clone` for type `&mut MyType<'_>`:
--> $DIR/pin-unsound-issue-66544-clone.rs:7:1 --> $DIR/pin-unsound-issue-66544-clone.rs:7:1
| |
LL | impl<'a> Clone for &'a mut MyType<'a> { LL | impl<'a> Clone for &'a mut MyType<'a> {

View file

@ -1,4 +1,4 @@
error[E0751]: found both positive and negative implementation of trait `std::ops::DerefMut` for type `&MyType<'_>`: error[E0751]: found both positive and negative implementation of trait `DerefMut` for type `&MyType<'_>`:
--> $DIR/pin-unsound-issue-66544-derefmut.rs:12:1 --> $DIR/pin-unsound-issue-66544-derefmut.rs:12:1
| |
LL | impl<'a> DerefMut for &'a MyType<'a> { LL | impl<'a> DerefMut for &'a MyType<'a> {

View file

@ -1,10 +1,10 @@
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:86:1 --> $DIR/issue-33140-traitobject-crate.rs:86:1
| |
LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { }
| ------------------------------------------------------ first implementation here | ------------------------------------------------------ first implementation here
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
@ -14,26 +14,26 @@ note: the lint level is defined here
LL | #![warn(order_dependent_trait_objects)] LL | #![warn(order_dependent_trait_objects)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:89:1 --> $DIR/issue-33140-traitobject-crate.rs:89:1
| |
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
| ------------------------------------------------------------- first implementation here | ------------------------------------------------------------- first implementation here
... ...
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:93:1 --> $DIR/issue-33140-traitobject-crate.rs:93:1
| |
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
| ------------------------------------------------------ first implementation here | ------------------------------------------------------ first implementation here
... ...
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
@ -41,13 +41,13 @@ LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
warning: 3 warnings emitted warning: 3 warnings emitted
Future incompatibility report: Future breakage diagnostic: Future incompatibility report: Future breakage diagnostic:
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:86:1 --> $DIR/issue-33140-traitobject-crate.rs:86:1
| |
LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { }
| ------------------------------------------------------ first implementation here | ------------------------------------------------------ first implementation here
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
@ -58,14 +58,14 @@ LL | #![warn(order_dependent_trait_objects)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic: Future breakage diagnostic:
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:89:1 --> $DIR/issue-33140-traitobject-crate.rs:89:1
| |
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
| ------------------------------------------------------------- first implementation here | ------------------------------------------------------------- first implementation here
... ...
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
@ -76,14 +76,14 @@ LL | #![warn(order_dependent_trait_objects)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Future breakage diagnostic: Future breakage diagnostic:
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119) warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:93:1 --> $DIR/issue-33140-traitobject-crate.rs:93:1
| |
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
| ------------------------------------------------------ first implementation here | ------------------------------------------------------ first implementation here
... ...
LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { } LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 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! = 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> = note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>

View file

@ -1,4 +1,4 @@
error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct` error[E0119]: conflicting implementations of trait `Send` for type `MyStruct`
--> $DIR/overlap-not-permitted-for-builtin-trait.rs:7:1 --> $DIR/overlap-not-permitted-for-builtin-trait.rs:7:1
| |
LL | impl !Send for MyStruct {} LL | impl !Send for MyStruct {}