Add new ToPredicate
impls and TraitRef
methods to remove some ty::Binber::dummy
calls
This commit is contained in:
parent
4f2532fb53
commit
1b8c7784e5
9 changed files with 46 additions and 32 deletions
|
@ -62,9 +62,8 @@ fn sized_constraint_for_ty<'tcx>(
|
|||
// it on the impl.
|
||||
|
||||
let Some(sized_trait) = tcx.lang_items().sized_trait() else { return vec![ty] };
|
||||
let sized_predicate = ty::Binder::dummy(ty::TraitRef::new(tcx, sized_trait, [ty]))
|
||||
.without_const()
|
||||
.to_predicate(tcx);
|
||||
let sized_predicate =
|
||||
ty::TraitRef::new(tcx, sized_trait, [ty]).without_const().to_predicate(tcx);
|
||||
let predicates = tcx.predicates_of(adtdef.did()).predicates;
|
||||
if predicates.iter().any(|(p, _)| *p == sized_predicate) { vec![] } else { vec![ty] }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue