| author | bors <bors@rust-lang.org> 2026-06-29 06:27:25 UTC |
| committer | bors <bors@rust-lang.org> 2026-06-29 06:27:25 UTC |
| log | 63f05e3635171e7ac3f9ca78bad6c71052cda5a3 |
| tree | 0498810592bf9e3d24a8d7d767eb77fec3974f1c |
| parent | 7fb284d9037fa54f6a9b24261c82b394472cbfd7 |
| parent | 5fad8a6a2313aa0c8d90197b55a0c644396fbc20 |
Remove redundant dyn-compatibility check.
This check is already handled in [`rustc_trait_selection::traits::fulfill::FulfillProcessor::process_obligation`](https://github.com/rust-lang/rust/blob/16761606d606b6ec4d0c88fc9251670742ad9fd2/compiler/rustc_trait_selection/src/traits/fulfill.rs#L524).
r? types1 files changed, 4 insertions(+), 6 deletions(-)
compiler/rustc_trait_selection/src/traits/select/mod.rs+4-6| ... | ... | @@ -771,12 +771,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 771 | 771 | Ok(EvaluatedToOkModuloRegions) |
| 772 | 772 | } |
| 773 | 773 | |
| 774 | ty::PredicateKind::DynCompatible(trait_def_id) => { | |
| 775 | if self.tcx().is_dyn_compatible(trait_def_id) { | |
| 776 | Ok(EvaluatedToOk) | |
| 777 | } else { | |
| 778 | Ok(EvaluatedToErr) | |
| 779 | } | |
| 774 | ty::PredicateKind::DynCompatible(_) => { | |
| 775 | bug!( | |
| 776 | "Obligation {obligation:?} should have been handled by fulfillment already." | |
| 777 | ) | |
| 780 | 778 | } |
| 781 | 779 | |
| 782 | 780 | ty::PredicateKind::Clause(ty::ClauseKind::Projection(data)) => { |