Lift TraitRef into rustc_type_ir

This commit is contained in:
Michael Goulet
2024-05-10 14:59:56 -04:00
parent 5e606c0bde
commit 1e5ec0a12c
51 changed files with 445 additions and 241 deletions

View File

@@ -525,8 +525,11 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
fn require_sized(&mut self, subty: Ty<'tcx>, cause: traits::ObligationCauseCode<'tcx>) {
if !subty.has_escaping_bound_vars() {
let cause = self.cause(cause);
let trait_ref =
ty::TraitRef::from_lang_item(self.tcx(), LangItem::Sized, cause.span, [subty]);
let trait_ref = ty::TraitRef::new(
self.tcx(),
self.tcx().require_lang_item(LangItem::Sized, Some(cause.span)),
[subty],
);
self.out.push(traits::Obligation::with_depth(
self.tcx(),
cause,