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