Add new ToPredicate impls and TraitRef methods to remove some ty::Binber::dummy calls

This commit is contained in:
Maybe Waffle
2023-04-26 11:48:17 +00:00
parent 4f2532fb53
commit 1b8c7784e5
9 changed files with 46 additions and 32 deletions

View File

@@ -1049,12 +1049,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
);
// We can only make objects from sized types.
let tr = ty::Binder::dummy(ty::TraitRef::from_lang_item(
tcx,
LangItem::Sized,
cause.span,
[source],
));
let tr = ty::TraitRef::from_lang_item(tcx, LangItem::Sized, cause.span, [source]);
nested.push(predicate_to_obligation(tr.without_const().to_predicate(tcx)));
// If the type is `Foo + 'a`, ensure that the type