diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-13 09:53:08 +0000 | 
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-02-20 13:39:39 +0000 | 
| commit | 8f6b18494641a9457b94e9f42bc88846e42dadbb (patch) | |
| tree | ab4cfd9a8f4dfbfb05a17d5c8a689babd6a662d2 /compiler/rustc_trait_selection/src/traits/select/mod.rs | |
| parent | eeb9035117dc85fa4abe8e2abb09285fd65b0263 (diff) | |
| download | rust-8f6b18494641a9457b94e9f42bc88846e42dadbb.tar.gz rust-8f6b18494641a9457b94e9f42bc88846e42dadbb.zip | |
Turn order dependent trait objects future incompat warning into a hard error
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/select/mod.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/mod.rs | 14 | 
1 files changed, 3 insertions, 11 deletions
| diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index 436ce3dddd9..7eba7fd6426 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -1920,9 +1920,9 @@ impl<'tcx> SelectionContext<'_, 'tcx> { let mut impl_candidate = None; for c in impls { if let Some(prev) = impl_candidate.replace(c) { - if self.prefer_lhs_over_victim(has_non_region_infer, c, prev) { + if self.prefer_lhs_over_victim(has_non_region_infer, c, prev.0) { // Ok, prefer `c` over the previous entry - } else if self.prefer_lhs_over_victim(has_non_region_infer, prev, c) { + } else if self.prefer_lhs_over_victim(has_non_region_infer, prev, c.0) { // Ok, keep `prev` instead of the new entry impl_candidate = Some(prev); } else { @@ -1981,7 +1981,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> { &self, has_non_region_infer: bool, (lhs, lhs_evaluation): (DefId, EvaluationResult), - (victim, victim_evaluation): (DefId, EvaluationResult), + victim: DefId, ) -> bool { let tcx = self.tcx(); // See if we can toss out `victim` based on specialization. @@ -1997,14 +1997,6 @@ impl<'tcx> SelectionContext<'_, 'tcx> { } match tcx.impls_are_allowed_to_overlap(lhs, victim) { - // For #33140 the impl headers must be exactly equal, the trait must not have - // any associated items and there are no where-clauses. - // - // We can just arbitrarily drop one of the impls. - Some(ty::ImplOverlapKind::FutureCompatOrderDepTraitObjects) => { - assert_eq!(lhs_evaluation, victim_evaluation); - true - } // For candidates which already reference errors it doesn't really // matter what we do 🤷 Some(ty::ImplOverlapKind::Permitted { marker: false }) => { | 
