shrinking the deprecated method span
This commit is contained in:
parent
6e92fb4098
commit
3efe0174a2
7 changed files with 167 additions and 131 deletions
|
@ -828,7 +828,15 @@ 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 = if path.segments.len() >= 2 {
|
||||
match path.segments.last() {
|
||||
Some(s) => Some(s.ident.span),
|
||||
None => None,
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
self.tcx.check_stability(def_id, Some(id), path.span, method_span)
|
||||
}
|
||||
intravisit::walk_path(self, path)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue