Change:
() same code with an additional line of whitespace/comments where indicated: however, the playground seems to behave different from my local nightly here Tested on label T-compiler requires-nightly F-markertraitattr A-traits A-typesystem and someone please add “I-unsound ”
ACTUALLY… the error after adding the whitespace disappears again with . Which would explain why it isn’t reproducable in the playground. Might be related to label A-incr-comp.
This test doesn't seem to compile with the most recent nightly but I don't think the underlying issue has been fixed. Not sure how to retrigger this issue

Discussion:
// See if we can toss out `victim` based on specialization. // This requires us to know *for sure* that the `other` impl applies // i.e., `EvaluatedToOk`. <ins> // // FIXME(@lcnr): Using `modulo_regions` here seems kind of scary // to me but is required for `std` to compile, so I didn't change it // for now. let tcx = self.tcx(); </ins> if other.evaluation.must_apply_modulo_regions() { <del> let tcx = self.tcx(); </del> if tcx.specializes((other_def, victim_def)) { return true; } <del> return match tcx.impls_are_allowed_to_overlap(other_def, victim_def) { </del> <ins> } if other.evaluation.must_apply_considering_regions() { match tcx.impls_are_allowed_to_overlap(other_def, victim_def) { </ins> Some(ty::ImplOverlapKind::Permitted { marker: true }) => { // Subtle: If the predicate we are evaluating has inference // variables, do *not* allow discarding candidates due to

} Some(_) => true, None => false, <del> }; </del> <ins> } </ins> } else { false }

<ins> // check-pass #![feature(marker_trait_attr)] #[marker] pub trait F {} impl<T> F for T where T: Copy {} impl<T> F for T where T: 'static {} fn main() {} </ins>

<ins> #![feature(marker_trait_attr)] #[marker] trait A {} impl<'a> A for (&'static (), &'a ()) {} //~ ERROR type annotations needed impl<'a> A for (&'a (), &'static ()) {} //~ ERROR type annotations needed fn main() {} </ins>

<ins> error[E0283]: type annotations needed --> $DIR/region-overlap.rs:5:10 | LL | impl<'a> A for (&'static (), &'a ()) {} |          ^ cannot infer type for tuple `(&'static (), &'a ())` | = note: cannot satisfy `(&'static (), &'a ()): A` note: required by a bound in `A` --> $DIR/region-overlap.rs:4:1 | LL | trait A {} | ^^^^^^^ required by this bound in `A` error[E0283]: type annotations needed --> $DIR/region-overlap.rs:6:10 | LL | impl<'a> A for (&'a (), &'static ()) {} |          ^ cannot infer type for tuple `(&'a (), &'static ())` | = note: cannot satisfy `(&'a (), &'static ()): A` note: required by a bound in `A` --> $DIR/region-overlap.rs:4:1 | LL | trait A {} | ^^^^^^^ required by this bound in `A` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0283`. </ins>

<ins> #![feature(marker_trait_attr)] #[marker] trait A {} trait B {} impl<T: A> B for T {} impl<T: B> A for T {} impl A for &str {} impl<T: A + B> A for (T,) {} trait TraitWithAssoc { type Assoc; } impl<T: A> TraitWithAssoc for T { type Assoc = T; } impl TraitWithAssoc for ((&str,),) { //~^ ERROR conflicting implementations type Assoc = ((&'static str,),); } fn main() {} </ins>

<ins> error[E0119]: conflicting implementations of trait `TraitWithAssoc` for type `((&str,),)` --> $DIR/unsound-overlap.rs:20:1 | LL | impl<T: A> TraitWithAssoc for T { | ------------------------------- first implementation here ... LL | impl TraitWithAssoc for ((&str,),) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `((&str,),)` error: aborting due to previous error For more information about this error, try `rustc --explain E0119`. </ins>