1
Fork 0

shrinking the deprecated method span

This commit is contained in:
hi-rustin 2021-06-15 16:21:58 +08:00
parent d74b36ea2f
commit 636d872452
8 changed files with 166 additions and 127 deletions

View file

@ -828,7 +828,11 @@ 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, None)
let method_span = match path.segments {
[.., _, last] => Some(last.ident.span),
_ => None,
};
self.tcx.check_stability(def_id, Some(id), path.span, method_span)
}
intravisit::walk_path(self, path)
}