From e49e69b68f8d8c4c7a01355e54a5593c86a1b5bf Mon Sep 17 00:00:00 2001 From: lcnr Date: Wed, 10 Jan 2024 17:44:36 +0100 Subject: [PATCH] remove the `coherence_leak_check` lint --- .../src/coherence/inherent_impls_overlap.rs | 13 +--- compiler/rustc_infer/src/infer/at.rs | 1 - compiler/rustc_infer/src/infer/mod.rs | 15 ---- .../src/infer/relate/higher_ranked.rs | 12 ++- compiler/rustc_lint/src/lib.rs | 5 ++ compiler/rustc_lint_defs/src/builtin.rs | 41 ---------- .../src/traits/coherence.rs | 38 ++++------ .../rustc_trait_selection/src/traits/mod.rs | 18 ----- .../src/traits/specialize/mod.rs | 2 - .../traits/specialize/specialization_graph.rs | 76 +++++-------------- .../codegen/subtyping-impacts-selection-1.rs | 1 - .../coherence/coherence-fn-implied-bounds.rs | 18 ++--- .../coherence-fn-implied-bounds.stderr | 20 ----- .../coherence-free-vs-bound-region.rs | 12 +-- .../coherence-free-vs-bound-region.stderr | 20 ----- .../coherence-inherited-subtyping.rs | 19 ----- .../coherence-inherited-subtyping.stderr | 14 ---- .../coherence-inherited-universe-error.rs | 19 +++++ tests/ui/coherence/coherence-subtyping.rs | 13 +--- tests/ui/coherence/coherence-subtyping.stderr | 16 ---- tests/ui/coherence/coherence-wasm-bindgen.rs | 13 +--- .../coherence/coherence-wasm-bindgen.stderr | 27 ------- ...constraints-on-unification.explicit.stderr | 19 ----- ...older-region-constraints-on-unification.rs | 6 +- .../occurs-check/associated-type.next.stderr | 4 - .../occurs-check/associated-type.old.stderr | 4 - tests/ui/const-generics/invariant.rs | 2 - tests/ui/const-generics/invariant.stderr | 18 +---- .../higher-ranked/leak-check-in-selection.rs | 1 - .../ui/mir/important-higher-ranked-regions.rs | 2 +- .../issue-118950-root-region.stderr | 4 - 31 files changed, 87 insertions(+), 386 deletions(-) delete mode 100644 tests/ui/coherence/coherence-fn-implied-bounds.stderr delete mode 100644 tests/ui/coherence/coherence-free-vs-bound-region.stderr delete mode 100644 tests/ui/coherence/coherence-inherited-subtyping.rs delete mode 100644 tests/ui/coherence/coherence-inherited-subtyping.stderr create mode 100644 tests/ui/coherence/coherence-inherited-universe-error.rs delete mode 100644 tests/ui/coherence/coherence-subtyping.stderr delete mode 100644 tests/ui/coherence/coherence-wasm-bindgen.stderr delete mode 100644 tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr diff --git a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs index 8f54bf00528cb..8352899d674b1 100644 --- a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs +++ b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs @@ -7,7 +7,7 @@ use rustc_index::IndexVec; use rustc_middle::traits::specialization_graph::OverlapMode; use rustc_middle::ty::{self, TyCtxt}; use rustc_span::Symbol; -use rustc_trait_selection::traits::{self, SkipLeakCheck}; +use rustc_trait_selection::traits; use smallvec::SmallVec; use std::collections::hash_map::Entry; @@ -139,15 +139,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> { impl1_def_id: DefId, impl2_def_id: DefId, ) { - let maybe_overlap = traits::overlapping_impls( - self.tcx, - impl1_def_id, - impl2_def_id, - // We go ahead and just skip the leak check for - // inherent impls without warning. - SkipLeakCheck::Yes, - overlap_mode, - ); + let maybe_overlap = + traits::overlapping_impls(self.tcx, impl1_def_id, impl2_def_id, overlap_mode); if let Some(overlap) = maybe_overlap { self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id, overlap); diff --git a/compiler/rustc_infer/src/infer/at.rs b/compiler/rustc_infer/src/infer/at.rs index 09313cd9738c2..b7fa3878aa3f7 100644 --- a/compiler/rustc_infer/src/infer/at.rs +++ b/compiler/rustc_infer/src/infer/at.rs @@ -78,7 +78,6 @@ impl<'tcx> InferCtxt<'tcx> { tcx: self.tcx, defining_use_anchor: self.defining_use_anchor, considering_regions: self.considering_regions, - skip_leak_check: self.skip_leak_check, inner: self.inner.clone(), lexical_region_resolutions: self.lexical_region_resolutions.clone(), selection_cache: self.selection_cache.clone(), diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index fa694f09f178d..a6cf28d0e09d5 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -256,12 +256,6 @@ pub struct InferCtxt<'tcx> { /// solving is left to borrowck instead. pub considering_regions: bool, - /// If set, this flag causes us to skip the 'leak check' during - /// higher-ranked subtyping operations. This flag is a temporary one used - /// to manage the removal of the leak-check: for the time being, we still run the - /// leak-check, but we issue warnings. - skip_leak_check: bool, - pub inner: RefCell>, /// Once region inference is done, the values for each variable. @@ -606,7 +600,6 @@ pub struct InferCtxtBuilder<'tcx> { tcx: TyCtxt<'tcx>, defining_use_anchor: DefiningAnchor, considering_regions: bool, - skip_leak_check: bool, /// Whether we are in coherence mode. intercrate: bool, /// Whether we should use the new trait solver in the local inference context, @@ -624,7 +617,6 @@ impl<'tcx> TyCtxtInferExt<'tcx> for TyCtxt<'tcx> { tcx: self, defining_use_anchor: DefiningAnchor::Error, considering_regions: true, - skip_leak_check: false, intercrate: false, next_trait_solver: self.next_trait_solver_globally(), } @@ -658,11 +650,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> { self } - pub fn skip_leak_check(mut self, skip_leak_check: bool) -> Self { - self.skip_leak_check = skip_leak_check; - self - } - /// Given a canonical value `C` as a starting point, create an /// inference context that contains each of the bound values /// within instantiated as a fresh variable. The `f` closure is @@ -688,7 +675,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> { tcx, defining_use_anchor, considering_regions, - skip_leak_check, intercrate, next_trait_solver, } = *self; @@ -696,7 +682,6 @@ impl<'tcx> InferCtxtBuilder<'tcx> { tcx, defining_use_anchor, considering_regions, - skip_leak_check, inner: RefCell::new(InferCtxtInner::new()), lexical_region_resolutions: RefCell::new(None), selection_cache: Default::default(), diff --git a/compiler/rustc_infer/src/infer/relate/higher_ranked.rs b/compiler/rustc_infer/src/infer/relate/higher_ranked.rs index 440df8c8936f9..3886ea985fd69 100644 --- a/compiler/rustc_infer/src/infer/relate/higher_ranked.rs +++ b/compiler/rustc_infer/src/infer/relate/higher_ranked.rs @@ -116,13 +116,11 @@ impl<'tcx> InferCtxt<'tcx> { outer_universe: ty::UniverseIndex, only_consider_snapshot: Option<&CombinedSnapshot<'tcx>>, ) -> RelateResult<'tcx, ()> { - // If the user gave `-Zno-leak-check`, or we have been - // configured to skip the leak check, then skip the leak check - // completely. The leak check is deprecated. Any legitimate - // subtyping errors that it would have caught will now be - // caught later on, during region checking. However, we - // continue to use it for a transition period. - if self.tcx.sess.opts.unstable_opts.no_leak_check || self.skip_leak_check { + // If the user gave `-Zno-leak-check`, then skip the leak check + // completely. While we considered to remove the leak check at + // some point, we are now confident that it will remain in some + // form or another. + if self.tcx.sess.opts.unstable_opts.no_leak_check { return Ok(()); } diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index a9996e4a155bf..dca5efccad86e 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -418,6 +418,11 @@ fn register_builtins(store: &mut LintStore) { "converted into hard error, see issue #48950 \ for more information", ); + store.register_removed( + "coherence_leak_check", + "no longer a warning, see issue #119820 \ + for more information", + ); store.register_removed( "resolve_trait_on_defaulted_unit", "converted into hard error, see issue #48950 \ diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index e917e7cb02b39..aede1c856f7d6 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -25,7 +25,6 @@ declare_lint_pass! { BREAK_WITH_LABEL_AND_LOOP, BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE, CENUM_IMPL_DROP_CAST, - COHERENCE_LEAK_CHECK, CONFLICTING_REPR_HINTS, CONST_EVALUATABLE_UNCHECKED, CONST_ITEM_MUTATION, @@ -1467,46 +1466,6 @@ declare_lint! { }; } -declare_lint! { - /// The `coherence_leak_check` lint detects conflicting implementations of - /// a trait that are only distinguished by the old leak-check code. - /// - /// ### Example - /// - /// ```rust - /// trait SomeTrait { } - /// impl SomeTrait for for<'a> fn(&'a u8) { } - /// impl<'a> SomeTrait for fn(&'a u8) { } - /// ``` - /// - /// {{produces}} - /// - /// ### Explanation - /// - /// In the past, the compiler would accept trait implementations for - /// identical functions that differed only in where the lifetime binder - /// appeared. Due to a change in the borrow checker implementation to fix - /// several bugs, this is no longer allowed. However, since this affects - /// existing code, this is a [future-incompatible] lint to transition this - /// to a hard error in the future. - /// - /// Code relying on this pattern should introduce "[newtypes]", - /// like `struct Foo(for<'a> fn(&'a u8))`. - /// - /// See [issue #56105] for more details. - /// - /// [issue #56105]: https://github.com/rust-lang/rust/issues/56105 - /// [newtypes]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#using-the-newtype-pattern-for-type-safety-and-abstraction - /// [future-incompatible]: ../index.md#future-incompatible-lints - pub COHERENCE_LEAK_CHECK, - Warn, - "distinct impls distinguished only by the leak-check code", - @future_incompatible = FutureIncompatibleInfo { - reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps, - reference: "issue #56105 ", - }; -} - declare_lint! { /// The `deprecated` lint detects use of deprecated items. /// diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index ecbb92ca5b996..8154d1a2c4c89 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -13,7 +13,6 @@ use crate::traits::query::evaluate_obligation::InferCtxtExt; use crate::traits::select::IntercrateAmbiguityCause; use crate::traits::structural_normalize::StructurallyNormalizeExt; use crate::traits::NormalizeExt; -use crate::traits::SkipLeakCheck; use crate::traits::{ Obligation, ObligationCause, ObligationCtxt, PredicateObligation, PredicateObligations, SelectionContext, @@ -84,12 +83,11 @@ impl TrackAmbiguityCauses { /// If there are types that satisfy both impls, returns `Some` /// with a suitably-freshened `ImplHeader` with those types /// substituted. Otherwise, returns `None`. -#[instrument(skip(tcx, skip_leak_check), level = "debug")] +#[instrument(skip(tcx), level = "debug")] pub fn overlapping_impls( tcx: TyCtxt<'_>, impl1_def_id: DefId, impl2_def_id: DefId, - skip_leak_check: SkipLeakCheck, overlap_mode: OverlapMode, ) -> Option> { // Before doing expensive operations like entering an inference context, do @@ -114,27 +112,14 @@ pub fn overlapping_impls( return None; } - let _overlap_with_bad_diagnostics = overlap( - tcx, - TrackAmbiguityCauses::No, - skip_leak_check, - impl1_def_id, - impl2_def_id, - overlap_mode, - )?; + let _overlap_with_bad_diagnostics = + overlap(tcx, TrackAmbiguityCauses::No, impl1_def_id, impl2_def_id, overlap_mode)?; // In the case where we detect an error, run the check again, but // this time tracking intercrate ambiguity causes for better // diagnostics. (These take time and can lead to false errors.) - let overlap = overlap( - tcx, - TrackAmbiguityCauses::Yes, - skip_leak_check, - impl1_def_id, - impl2_def_id, - overlap_mode, - ) - .unwrap(); + let overlap = + overlap(tcx, TrackAmbiguityCauses::Yes, impl1_def_id, impl2_def_id, overlap_mode).unwrap(); Some(overlap) } @@ -176,7 +161,6 @@ fn fresh_impl_header_normalized<'tcx>( fn overlap<'tcx>( tcx: TyCtxt<'tcx>, track_ambiguity_causes: TrackAmbiguityCauses, - skip_leak_check: SkipLeakCheck, impl1_def_id: DefId, impl2_def_id: DefId, overlap_mode: OverlapMode, @@ -192,7 +176,6 @@ fn overlap<'tcx>( let infcx = tcx .infer_ctxt() .with_opaque_type_inference(DefiningAnchor::Bubble) - .skip_leak_check(skip_leak_check.is_yes()) .intercrate(true) .with_next_trait_solver(tcx.next_trait_solver_in_coherence()) .build(); @@ -230,8 +213,15 @@ fn overlap<'tcx>( } } - // We toggle the `leak_check` by using `skip_leak_check` when constructing the - // inference context, so this may be a noop. + // Detect any region errors caused by equating these two impls. + // + // Only higher ranked region errors are possible here, given that we + // replaced all parameter regions with existentials. + // + // Unlike a full region check, which sometimes incompletely handles + // `TypeOutlives` constraints, the leak check is a complete. While the + // leak check does not detect all region errors, it never + // fails in cases which would later pass full region checking. if infcx.leak_check(ty::UniverseIndex::ROOT, None).is_err() { debug!("overlap: leak check failed"); return None; diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index 080ad7bd549c8..7115f007a60dd 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -70,24 +70,6 @@ pub use self::util::{get_vtable_index_of_object_method, impl_item_is_final, upca pub use rustc_infer::traits::*; -/// Whether to skip the leak check, as part of a future compatibility warning step. -/// -/// The "default" for skip-leak-check corresponds to the current -/// behavior (do not skip the leak check) -- not the behavior we are -/// transitioning into. -#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)] -pub enum SkipLeakCheck { - Yes, - #[default] - No, -} - -impl SkipLeakCheck { - fn is_yes(self) -> bool { - self == SkipLeakCheck::Yes - } -} - /// The mode that trait queries run in. #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum TraitQueryMode { diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs index 10329c623b386..e1345ba8d6dcd 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs @@ -24,7 +24,6 @@ use rustc_errors::{error_code, DelayDm, Diagnostic}; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::ty::{self, ImplSubject, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{GenericArgs, GenericArgsRef}; -use rustc_session::lint::builtin::COHERENCE_LEAK_CHECK; use rustc_session::lint::builtin::ORDER_DEPENDENT_TRAIT_OBJECTS; use rustc_span::{Span, DUMMY_SP}; @@ -441,7 +440,6 @@ fn report_conflicting_impls<'tcx>( Some(kind) => { let lint = match kind { FutureCompatOverlapErrorKind::Issue33140 => ORDER_DEPENDENT_TRAIT_OBJECTS, - FutureCompatOverlapErrorKind::LeakCheck => COHERENCE_LEAK_CHECK, }; tcx.struct_span_lint_hir( lint, diff --git a/compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs b/compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs index e9a592bdee799..ca4c12b1dd5a1 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/specialization_graph.rs @@ -11,7 +11,6 @@ pub use rustc_middle::traits::specialization_graph::*; #[derive(Copy, Clone, Debug)] pub enum FutureCompatOverlapErrorKind { Issue33140, - LeakCheck, } #[derive(Debug)] @@ -118,64 +117,31 @@ impl<'tcx> ChildrenExt<'tcx> for Children { } }; - let report_overlap_error = |overlap: traits::coherence::OverlapResult<'tcx>, - last_lint: &mut _| { - // Found overlap, but no specialization; error out or report future-compat warning. - - // Do we *still* get overlap if we disable the future-incompatible modes? - let should_err = traits::overlapping_impls( - tcx, - possible_sibling, - impl_def_id, - traits::SkipLeakCheck::default(), - overlap_mode, - ) - .is_some(); - - let error = create_overlap_error(overlap); - - if should_err { - Err(error) - } else { - *last_lint = Some(FutureCompatOverlapError { - error, - kind: FutureCompatOverlapErrorKind::LeakCheck, - }); - - Ok((false, false)) - } - }; - let last_lint_mut = &mut last_lint; - let (le, ge) = traits::overlapping_impls( - tcx, - possible_sibling, - impl_def_id, - traits::SkipLeakCheck::Yes, - overlap_mode, - ) - .map_or(Ok((false, false)), |overlap| { - if let Some(overlap_kind) = - tcx.impls_are_allowed_to_overlap(impl_def_id, possible_sibling) - { - match overlap_kind { - ty::ImplOverlapKind::Permitted { marker: _ } => {} - ty::ImplOverlapKind::Issue33140 => { - *last_lint_mut = Some(FutureCompatOverlapError { - error: create_overlap_error(overlap), - kind: FutureCompatOverlapErrorKind::Issue33140, - }); + let (le, ge) = + traits::overlapping_impls(tcx, possible_sibling, impl_def_id, overlap_mode) + .map_or(Ok((false, false)), |overlap| { + if let Some(overlap_kind) = + tcx.impls_are_allowed_to_overlap(impl_def_id, possible_sibling) + { + match overlap_kind { + ty::ImplOverlapKind::Permitted { marker: _ } => {} + ty::ImplOverlapKind::Issue33140 => { + *last_lint_mut = Some(FutureCompatOverlapError { + error: create_overlap_error(overlap), + kind: FutureCompatOverlapErrorKind::Issue33140, + }); + } + } + + return Ok((false, false)); } - } - - return Ok((false, false)); - } - let le = tcx.specializes((impl_def_id, possible_sibling)); - let ge = tcx.specializes((possible_sibling, impl_def_id)); + let le = tcx.specializes((impl_def_id, possible_sibling)); + let ge = tcx.specializes((possible_sibling, impl_def_id)); - if le == ge { report_overlap_error(overlap, last_lint_mut) } else { Ok((le, ge)) } - })?; + if le == ge { Err(create_overlap_error(overlap)) } else { Ok((le, ge)) } + })?; if le && !ge { debug!( diff --git a/tests/ui/codegen/subtyping-impacts-selection-1.rs b/tests/ui/codegen/subtyping-impacts-selection-1.rs index 09e06f6d6843b..0702f666a83c0 100644 --- a/tests/ui/codegen/subtyping-impacts-selection-1.rs +++ b/tests/ui/codegen/subtyping-impacts-selection-1.rs @@ -4,7 +4,6 @@ //[codegen] compile-flags: -Zmir-opt-level=0 // A regression test for #107205 -#![allow(coherence_leak_check)] struct Foo(T); fn useful<'a>(_: &'a u8) {} diff --git a/tests/ui/coherence/coherence-fn-implied-bounds.rs b/tests/ui/coherence/coherence-fn-implied-bounds.rs index 4539af9a32e38..0bf734d70722d 100644 --- a/tests/ui/coherence/coherence-fn-implied-bounds.rs +++ b/tests/ui/coherence/coherence-fn-implied-bounds.rs @@ -4,23 +4,15 @@ // bounds we ought to know that, in fact, `'a = 'b` must always hold, // and hence they are. // -// Rustc can't figure this out and hence it accepts the impls but -// gives a future-compatibility warning (because we'd like to make -// this an error someday). -// -// Note that while we would like to make this a hard error, we also -// give the same warning for `coherence-wasm-bindgen.rs`, which ought -// to be accepted. +// Rustc can't figure this out and hence it accepts the impls. This is +// a bit unfortunate as we will error here if we ever consider implied bounds +// when equating higher ranked types. -#![deny(coherence_leak_check)] +// check-pass trait Trait {} impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {} - -impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 { - //~^ ERROR conflicting implementations - //~| WARNING this was previously accepted by the compiler -} +impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {} fn main() {} diff --git a/tests/ui/coherence/coherence-fn-implied-bounds.stderr b/tests/ui/coherence/coherence-fn-implied-bounds.stderr deleted file mode 100644 index b0dea74670925..0000000000000 --- a/tests/ui/coherence/coherence-fn-implied-bounds.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32` - --> $DIR/coherence-fn-implied-bounds.rs:21:1 - | -LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {} - | ------------------------------------------------------------------ first implementation here -LL | -LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32` - | - = 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 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/coherence-fn-implied-bounds.rs:15:9 - | -LL | #![deny(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/coherence/coherence-free-vs-bound-region.rs b/tests/ui/coherence/coherence-free-vs-bound-region.rs index 2f5c49d293d5d..472048c8bb76f 100644 --- a/tests/ui/coherence/coherence-free-vs-bound-region.rs +++ b/tests/ui/coherence/coherence-free-vs-bound-region.rs @@ -1,21 +1,17 @@ // Capture a coherence pattern from wasm-bindgen that we discovered as part of -// future-compatibility warning #56105. This pattern currently receives a lint -// warning but we probably want to support it long term. +// future-compatibility warning #56105. This pattern pattern relies on coherence +// considering implementations to not overlap if there are universe errors. // // Key distinction: we are implementing once for `A` (take ownership) and one // for `&A` (borrow). // // c.f. #56105 -#![deny(coherence_leak_check)] +// check-pass trait TheTrait {} impl<'a> TheTrait for fn(&'a u8) {} - -impl TheTrait for fn(&u8) { - //~^ ERROR conflicting implementations of trait - //~| WARNING this was previously accepted by the compiler -} +impl TheTrait for fn(&u8) {} fn main() {} diff --git a/tests/ui/coherence/coherence-free-vs-bound-region.stderr b/tests/ui/coherence/coherence-free-vs-bound-region.stderr deleted file mode 100644 index c97b32e429d37..0000000000000 --- a/tests/ui/coherence/coherence-free-vs-bound-region.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: conflicting implementations of trait `TheTrait` for type `fn(&u8)` - --> $DIR/coherence-free-vs-bound-region.rs:16:1 - | -LL | impl<'a> TheTrait for fn(&'a u8) {} - | -------------------------------- first implementation here -LL | -LL | impl TheTrait for fn(&u8) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)` - | - = 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 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/coherence-free-vs-bound-region.rs:10:9 - | -LL | #![deny(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/coherence/coherence-inherited-subtyping.rs b/tests/ui/coherence/coherence-inherited-subtyping.rs deleted file mode 100644 index f35cd2103da4a..0000000000000 --- a/tests/ui/coherence/coherence-inherited-subtyping.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Test that two distinct impls which match subtypes of one another -// yield coherence errors (or not) depending on the variance. -// -// Note: This scenario is currently accepted, but as part of the -// universe transition (#56105) may eventually become an error. - -struct Foo { - t: T, -} - -impl Foo fn(&'a u8, &'b u8) -> &'a u8> { - fn method1(&self) {} //~ ERROR duplicate definitions with name `method1` -} - -impl Foo fn(&'a u8, &'a u8) -> &'a u8> { - fn method1(&self) {} -} - -fn main() {} diff --git a/tests/ui/coherence/coherence-inherited-subtyping.stderr b/tests/ui/coherence/coherence-inherited-subtyping.stderr deleted file mode 100644 index 5c5753939049e..0000000000000 --- a/tests/ui/coherence/coherence-inherited-subtyping.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0592]: duplicate definitions with name `method1` - --> $DIR/coherence-inherited-subtyping.rs:12:5 - | -LL | fn method1(&self) {} - | ^^^^^^^^^^^^^^^^^ duplicate definitions for `method1` -... -LL | fn method1(&self) {} - | ----------------- other definition for `method1` - | - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/tests/ui/coherence/coherence-inherited-universe-error.rs b/tests/ui/coherence/coherence-inherited-universe-error.rs new file mode 100644 index 0000000000000..21f1b604f9079 --- /dev/null +++ b/tests/ui/coherence/coherence-inherited-universe-error.rs @@ -0,0 +1,19 @@ +// Test that impls which are only distict due to +// universe errors are accepted. This was previously +// not the case. + +// check-pass + +struct Foo { + t: T, +} + +impl Foo fn(&'a u8, &'b u8) -> &'a u8> { + fn method1(&self) {} +} + +impl Foo fn(&'a u8, &'a u8) -> &'a u8> { + fn method1(&self) {} +} + +fn main() {} diff --git a/tests/ui/coherence/coherence-subtyping.rs b/tests/ui/coherence/coherence-subtyping.rs index b3ed728a81c06..5d0aea999a05f 100644 --- a/tests/ui/coherence/coherence-subtyping.rs +++ b/tests/ui/coherence/coherence-subtyping.rs @@ -1,8 +1,6 @@ -// Test that two distinct impls which match subtypes of one another -// yield coherence errors (or not) depending on the variance. -// -// Note: This scenario is currently accepted, but as part of the -// universe transition (#56105) may eventually become an error. +// Test that impls whose self types are subtypes of each other and +// which only differ due to a universe error are considered disjoint +// by coherence. // check-pass @@ -12,9 +10,6 @@ trait TheTrait { impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} -impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { - //~^ WARNING conflicting implementation - //~^^ WARNING this was previously accepted by the compiler but is being phased out -} +impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {} fn main() {} diff --git a/tests/ui/coherence/coherence-subtyping.stderr b/tests/ui/coherence/coherence-subtyping.stderr deleted file mode 100644 index 9d90019a50fd3..0000000000000 --- a/tests/ui/coherence/coherence-subtyping.stderr +++ /dev/null @@ -1,16 +0,0 @@ -warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - --> $DIR/coherence-subtyping.rs:15:1 - | -LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} - | ---------------------------------------------------------- first implementation here -LL | -LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - | - = 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 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - = note: `#[warn(coherence_leak_check)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/coherence/coherence-wasm-bindgen.rs b/tests/ui/coherence/coherence-wasm-bindgen.rs index ee09a72449be1..6ec576a309499 100644 --- a/tests/ui/coherence/coherence-wasm-bindgen.rs +++ b/tests/ui/coherence/coherence-wasm-bindgen.rs @@ -1,13 +1,8 @@ // Capture a coherence pattern from wasm-bindgen that we discovered as part of -// future-compatibility warning #56105. This pattern currently receives a lint -// warning but we probably want to support it long term. -// -// Key distinction: we are implementing once for `A` (take ownership) and one -// for `&A` (borrow). -// -// c.f. #56105 +// future-compatibility warning #56105. This pattern relies on universe +// errors impacting selection and is something we want to support. -#![deny(coherence_leak_check)] +// check-pass trait IntoWasmAbi { fn some_method(&self) {} @@ -30,8 +25,6 @@ where A: RefFromWasmAbi, R: ReturnWasmAbi, { - //~^^^^^ ERROR conflicting implementation - //~| WARNING this was previously accepted } fn main() {} diff --git a/tests/ui/coherence/coherence-wasm-bindgen.stderr b/tests/ui/coherence/coherence-wasm-bindgen.stderr deleted file mode 100644 index b3c3dac612dbd..0000000000000 --- a/tests/ui/coherence/coherence-wasm-bindgen.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn Fn(&_) -> _` - --> $DIR/coherence-wasm-bindgen.rs:28:1 - | -LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) -LL | | where -LL | | A: FromWasmAbi, -LL | | R: ReturnWasmAbi, - | |_____________________- first implementation here -... -LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b) -LL | | where -LL | | A: RefFromWasmAbi, -LL | | R: ReturnWasmAbi, - | |_____________________^ 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! - = note: for more information, see issue #56105 - = note: downstream crates may implement trait `FromWasmAbi` for type `&_` - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/coherence-wasm-bindgen.rs:10:9 - | -LL | #![deny(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr deleted file mode 100644 index 5368db293383c..0000000000000 --- a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.explicit.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error: conflicting implementations of trait `FnMarker` for type `fn(&_)` - --> $DIR/negative-coherence-placeholder-region-constraints-on-unification.rs:21:1 - | -LL | impl FnMarker for fn(T) {} - | ------------------------------------------- first implementation here -LL | impl FnMarker for fn(&T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&_)` - | - = 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 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/negative-coherence-placeholder-region-constraints-on-unification.rs:4:11 - | -LL | #![forbid(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs index 26d9d84d8f0c9..b1ecb12e49f02 100644 --- a/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs +++ b/tests/ui/coherence/negative-coherence-placeholder-region-constraints-on-unification.rs @@ -1,7 +1,5 @@ // revisions: explicit implicit -//[implicit] check-pass - -#![forbid(coherence_leak_check)] +// check-pass #![feature(negative_impls, with_negative_coherence)] pub trait Marker {} @@ -19,7 +17,5 @@ trait FnMarker {} // as an assumption when proving `&'!0 T: Marker`... impl FnMarker for fn(T) {} impl FnMarker for fn(&T) {} -//[explicit]~^ ERROR conflicting implementations of trait `FnMarker` for type `fn(&_)` -//[explicit]~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! fn main() {} diff --git a/tests/ui/coherence/occurs-check/associated-type.next.stderr b/tests/ui/coherence/occurs-check/associated-type.next.stderr index f64e8b397987b..8b5e4aec0530d 100644 --- a/tests/ui/coherence/occurs-check/associated-type.next.stderr +++ b/tests/ui/coherence/occurs-check/associated-type.next.stderr @@ -2,10 +2,6 @@ WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!2_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) error[E0119]: conflicting implementations of trait `Overlap fn(&'a (), ())>` for type `for<'a> fn(&'a (), ())` --> $DIR/associated-type.rs:31:1 | diff --git a/tests/ui/coherence/occurs-check/associated-type.old.stderr b/tests/ui/coherence/occurs-check/associated-type.old.stderr index 8e852ec796ede..6a16ca9906e08 100644 --- a/tests/ui/coherence/occurs-check/associated-type.old.stderr +++ b/tests/ui/coherence/occurs-check/associated-type.old.stderr @@ -2,10 +2,6 @@ WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Projection, AliasTy { args: [*const ?1t, RePlaceholder(!3_BoundRegion { var: 0, kind: BrNamed(DefId(0:27 ~ associated_type[f554]::{impl#3}::'a#1), 'a) })], def_id: DefId(0:5 ~ associated_type[f554]::ToUnit::Unit) }) error[E0119]: conflicting implementations of trait `Overlap fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)` --> $DIR/associated-type.rs:31:1 | diff --git a/tests/ui/const-generics/invariant.rs b/tests/ui/const-generics/invariant.rs index 39d658be67d40..fb041b141bddd 100644 --- a/tests/ui/const-generics/invariant.rs +++ b/tests/ui/const-generics/invariant.rs @@ -12,8 +12,6 @@ impl SadBee for for<'a> fn(&'a ()) { const ASSOC: usize = 0; } impl SadBee for fn(&'static ()) { - //~^ WARNING conflicting implementations of trait - //~| WARNING this was previously accepted const ASSOC: usize = 100; } diff --git a/tests/ui/const-generics/invariant.stderr b/tests/ui/const-generics/invariant.stderr index f631e1311460f..2b66036798f02 100644 --- a/tests/ui/const-generics/invariant.stderr +++ b/tests/ui/const-generics/invariant.stderr @@ -1,19 +1,5 @@ -warning: conflicting implementations of trait `SadBee` for type `for<'a> fn(&'a ())` - --> $DIR/invariant.rs:14:1 - | -LL | impl SadBee for for<'a> fn(&'a ()) { - | ---------------------------------- first implementation here -... -LL | impl SadBee for fn(&'static ()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())` - | - = 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 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - = note: `#[warn(coherence_leak_check)]` on by default - error[E0308]: mismatched types - --> $DIR/invariant.rs:27:5 + --> $DIR/invariant.rs:25:5 | LL | v | ^ one type is more general than the other @@ -21,6 +7,6 @@ LL | v = note: expected reference `&Foo` found reference `&Foo fn(&'a ())>` -error: aborting due to 1 previous error; 1 warning emitted +error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/higher-ranked/leak-check-in-selection.rs b/tests/ui/higher-ranked/leak-check-in-selection.rs index 5b36902ffdfe8..d8f83dbbc12aa 100644 --- a/tests/ui/higher-ranked/leak-check-in-selection.rs +++ b/tests/ui/higher-ranked/leak-check-in-selection.rs @@ -1,7 +1,6 @@ // run-pass // revisions: old next //[next] compile-flags: -Znext-solver -#![allow(coherence_leak_check)] trait Trait: Sized { fn is_higher_ranked(self) -> bool; diff --git a/tests/ui/mir/important-higher-ranked-regions.rs b/tests/ui/mir/important-higher-ranked-regions.rs index cadfb3b66f297..877c564b0c18c 100644 --- a/tests/ui/mir/important-higher-ranked-regions.rs +++ b/tests/ui/mir/important-higher-ranked-regions.rs @@ -3,7 +3,7 @@ // This test checks that bivariant parameters are handled correctly // in the mir. -#![allow(coherence_leak_check)] + trait Trait { type Assoc; } diff --git a/tests/ui/traits/next-solver/issue-118950-root-region.stderr b/tests/ui/traits/next-solver/issue-118950-root-region.stderr index c16a48d5f154c..489fa4daedc56 100644 --- a/tests/ui/traits/next-solver/issue-118950-root-region.stderr +++ b/tests/ui/traits/next-solver/issue-118950-root-region.stderr @@ -13,10 +13,6 @@ LL | #![feature(lazy_type_alias)] = note: see issue #112792 for more information = note: `#[warn(incomplete_features)]` on by default -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }) -WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [RePlaceholder(!1_BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) }) WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: Alias(Weak, AliasTy { args: [ReBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:15 ~ issue_118950_root_region[d54f]::{impl#1}::'a), 'a) }), ?1t], def_id: DefId(0:8 ~ issue_118950_root_region[d54f]::Assoc) })