diff options
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/wf.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/wf.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs index fce92c66ee8..3fe019cb7de 100644 --- a/compiler/rustc_trait_selection/src/traits/wf.rs +++ b/compiler/rustc_trait_selection/src/traits/wf.rs @@ -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, |
