try fast path for wf type ops · rust-lang/rust@66090ef (original) (raw)

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -30,6 +30,23 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
30 30 }
31 31 }
32 32
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 +
33 50 None
34 51 }
35 52