Skip to content

Commit bed395e

Browse files
committed
try to speed up try_fast_path sizedness check
1 parent c846d9f commit bed395e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
1616
// we have to prove. No need to canonicalize and all that for
1717
// such cases.
1818
if let ty::PredicateKind::Trait(trait_ref) = key.value.predicate.kind().skip_binder() {
19+
if trait_ref.implicit == ty::ImplicitBound::Yes {
20+
return Some(());
21+
}
1922
if let Some(sized_def_id) = tcx.lang_items().sized_trait() {
2023
if trait_ref.def_id() == sized_def_id {
2124
if trait_ref.self_ty().is_trivially_sized(tcx) {

0 commit comments

Comments
 (0)