Add Option<Span> to require_lang_item

This commit is contained in:
Yuki Okushi 2019-08-28 06:17:58 +09:00
parent 7e0afdad28
commit 82f2b37635
19 changed files with 39 additions and 28 deletions

View file

@ -464,7 +464,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
// it is *not* required (i.e., '?Sized')
let sized_trait = self.cx
.tcx
.require_lang_item(lang_items::SizedTraitLangItem);
.require_lang_item(lang_items::SizedTraitLangItem, None);
let mut replacer = RegionReplacer {
vid_to_region: &vid_to_region,
@ -777,9 +777,9 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
fn is_fn_ty(&self, tcx: TyCtxt<'_>, ty: &Type) -> bool {
match &ty {
&&Type::ResolvedPath { ref did, .. } => {
*did == tcx.require_lang_item(lang_items::FnTraitLangItem)
|| *did == tcx.require_lang_item(lang_items::FnMutTraitLangItem)
|| *did == tcx.require_lang_item(lang_items::FnOnceTraitLangItem)
*did == tcx.require_lang_item(lang_items::FnTraitLangItem, None)
|| *did == tcx.require_lang_item(lang_items::FnMutTraitLangItem, None)
|| *did == tcx.require_lang_item(lang_items::FnOnceTraitLangItem, None)
}
_ => false,
}

View file

@ -1060,7 +1060,7 @@ pub enum GenericBound {
impl GenericBound {
fn maybe_sized(cx: &DocContext<'_>) -> GenericBound {
let did = cx.tcx.require_lang_item(lang_items::SizedTraitLangItem);
let did = cx.tcx.require_lang_item(lang_items::SizedTraitLangItem, None);
let empty = cx.tcx.intern_substs(&[]);
let path = external_path(cx, &cx.tcx.item_name(did).as_str(),
Some(did), false, vec![], empty);