diff options
| author | Michael Goulet <michael@errs.io> | 2025-07-02 00:30:10 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-07-02 00:33:06 +0000 |
| commit | d3c0ef0c9fb000d09529e2ff71ed2e69e224a8d6 (patch) | |
| tree | a1cae701c7814119f756dd1b2ab4556ee40be6d8 /compiler/rustc_trait_selection/src | |
| parent | ae0bef778ab184636f06266fab5fbdec306e2ca1 (diff) | |
| download | rust-d3c0ef0c9fb000d09529e2ff71ed2e69e224a8d6.tar.gz rust-d3c0ef0c9fb000d09529e2ff71ed2e69e224a8d6.zip | |
Use is_trivially_wf for ProvePredicate fast path
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs index 18971c47831..22eeb285b37 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs @@ -21,19 +21,9 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> { if let ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(term)) = key.value.predicate.kind().skip_binder() + && term.is_trivially_wf(tcx) { - match term.as_type()?.kind() { - ty::Param(_) - | ty::Bool - | ty::Char - | ty::Int(_) - | ty::Float(_) - | ty::Str - | ty::Uint(_) => { - return Some(()); - } - _ => {} - } + return Some(()); } None |
