Rollup merge of #64439 - 12101111:fix-owned-box, r=Centril

fix #64430, confusing `owned_box` error message in no_std build

Fixes #64430
This commit is contained in:
Mazdak Farrokhzad 2019-09-14 16:42:42 +02:00 committed by GitHub
commit 1c7959bb5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 26 deletions

View file

@ -2396,9 +2396,9 @@ impl<'tcx> TyCtxt<'tcx> {
}
#[inline]
pub fn mk_lang_item(self, ty: Ty<'tcx>, item: lang_items::LangItem) -> Ty<'tcx> {
let def_id = self.require_lang_item(item, None);
self.mk_generic_adt(def_id, ty)
pub fn mk_lang_item(self, ty: Ty<'tcx>, item: lang_items::LangItem) -> Option<Ty<'tcx>> {
let def_id = self.lang_items().require(item).ok()?;
Some(self.mk_generic_adt(def_id, ty))
}
#[inline]