Assert that various types have the right amount of generic args and fix the sites that used the wrong amount

This commit is contained in:
Oli Scherer
2022-11-17 11:21:39 +00:00
parent d9a02b0fb7
commit 6f77c97b38
27 changed files with 153 additions and 144 deletions

View File

@@ -421,10 +421,11 @@ impl<'tcx> WfPredicates<'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 {
def_id: self.tcx.require_lang_item(LangItem::Sized, None),
substs: self.tcx.mk_substs_trait(subty, &[]),
};
let trait_ref = self.tcx.mk_trait_ref(
self.tcx.require_lang_item(LangItem::Sized, None),
subty,
&[],
);
self.out.push(traits::Obligation::with_depth(
self.tcx,
cause,