Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnr
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
This commit is contained in:
commit
6f8c0557e0
49 changed files with 246 additions and 181 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(tcx.mk_trait_ref(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