Skip to content

Commit a529e70

Browse files
authored
Rollup merge of #68274 - matthiaskrgr:dead_code, r=Dylan-DPC
remove dead code The condition `if obligation.recursion_depth >= 0` is always true since `recursion_depth` is `usize`. The else branch is dead code and can be removed. Found by Clippy. Fixes #68251
2 parents 6e797ff + c4d91aa commit a529e70

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/librustc/traits/select.rs

+6-10
Original file line numberDiff line numberDiff line change
@@ -3767,16 +3767,12 @@ impl<'tcx> TraitObligation<'tcx> {
37673767
// NOTE(flaper87): As of now, it keeps track of the whole error
37683768
// chain. Ideally, we should have a way to configure this either
37693769
// by using -Z verbose or just a CLI argument.
3770-
if obligation.recursion_depth >= 0 {
3771-
let derived_cause = DerivedObligationCause {
3772-
parent_trait_ref: obligation.predicate.to_poly_trait_ref(),
3773-
parent_code: Rc::new(obligation.cause.code.clone()),
3774-
};
3775-
let derived_code = variant(derived_cause);
3776-
ObligationCause::new(obligation.cause.span, obligation.cause.body_id, derived_code)
3777-
} else {
3778-
obligation.cause.clone()
3779-
}
3770+
let derived_cause = DerivedObligationCause {
3771+
parent_trait_ref: obligation.predicate.to_poly_trait_ref(),
3772+
parent_code: Rc::new(obligation.cause.code.clone()),
3773+
};
3774+
let derived_code = variant(derived_cause);
3775+
ObligationCause::new(obligation.cause.span, obligation.cause.body_id, derived_code)
37803776
}
37813777
}
37823778

0 commit comments

Comments
 (0)