Skip to content

Commit 66090ef

Browse files
aliemjaylcnr
authored andcommitted
try fast path for wf type ops
1 parent aac2f84 commit 66090ef

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

+17
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
3030
}
3131
}
3232

33+
if let ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) =
34+
key.value.predicate.kind().skip_binder()
35+
{
36+
match arg.as_type()?.kind() {
37+
ty::Param(_)
38+
| ty::Bool
39+
| ty::Char
40+
| ty::Int(_)
41+
| ty::Float(_)
42+
| ty::Str
43+
| ty::Uint(_) => {
44+
return Some(());
45+
}
46+
_ => {}
47+
}
48+
}
49+
3350
None
3451
}
3552

0 commit comments

Comments
 (0)