authorbors <bors@rust-lang.org> 2026-06-29 06:27:25 UTC
committerbors <bors@rust-lang.org> 2026-06-29 06:27:25 UTC
log63f05e3635171e7ac3f9ca78bad6c71052cda5a3
tree0498810592bf9e3d24a8d7d767eb77fec3974f1c
parent7fb284d9037fa54f6a9b24261c82b394472cbfd7
parent5fad8a6a2313aa0c8d90197b55a0c644396fbc20

Auto merge of #158477 - theemathas:del-dyn-compat-check, r=oli-obk

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? types

1 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> {
771771 Ok(EvaluatedToOkModuloRegions)
772772 }
773773
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 )
780778 }
781779
782780 ty::PredicateKind::Clause(ty::ClauseKind::Projection(data)) => {