Skip to content

Commit d3c0ef0

Browse files
Use is_trivially_wf for ProvePredicate fast path
1 parent ae0bef7 commit d3c0ef0

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,9 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
2121

2222
if let ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(term)) =
2323
key.value.predicate.kind().skip_binder()
24+
&& term.is_trivially_wf(tcx)
2425
{
25-
match term.as_type()?.kind() {
26-
ty::Param(_)
27-
| ty::Bool
28-
| ty::Char
29-
| ty::Int(_)
30-
| ty::Float(_)
31-
| ty::Str
32-
| ty::Uint(_) => {
33-
return Some(());
34-
}
35-
_ => {}
36-
}
26+
return Some(());
3727
}
3828

3929
None

0 commit comments

Comments
 (0)