1
Fork 0

shrinking the deprecated method span

This commit is contained in:
hi-rustin 2021-05-07 10:41:04 +08:00
parent 2d11e25794
commit f6dd332820
12 changed files with 159 additions and 98 deletions

View file

@ -739,7 +739,7 @@ impl Visitor<'tcx> for Checker<'tcx> {
None => return,
};
let def_id = DefId { krate: cnum, index: CRATE_DEF_INDEX };
self.tcx.check_stability(def_id, Some(item.hir_id()), item.span);
self.tcx.check_stability(def_id, Some(item.hir_id()), item.span, None);
}
// For implementations of traits, check the stability of each item
@ -783,7 +783,7 @@ impl Visitor<'tcx> for Checker<'tcx> {
.map(|item| item.def_id);
if let Some(def_id) = trait_item_def_id {
// Pass `None` to skip deprecation warnings.
self.tcx.check_stability(def_id, None, impl_item.span);
self.tcx.check_stability(def_id, None, impl_item.span, None);
}
}
}
@ -832,7 +832,7 @@ impl Visitor<'tcx> for Checker<'tcx> {
fn visit_path(&mut self, path: &'tcx hir::Path<'tcx>, id: hir::HirId) {
if let Some(def_id) = path.res.opt_def_id() {
self.tcx.check_stability(def_id, Some(id), path.span)
self.tcx.check_stability(def_id, Some(id), path.span, None)
}
intravisit::walk_path(self, path)
}