Skip to content

Commit 63f05e3

Browse files
committed
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
2 parents 7fb284d + 5fad8a6 commit 63f05e3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • compiler/rustc_trait_selection/src/traits/select

compiler/rustc_trait_selection/src/traits/select/mod.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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)) => {

0 commit comments

Comments
 (0)