Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Jun 2, 2021
1 parent c180af8 commit 957e2ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compiler/rustc_passes/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,9 @@ 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() {
let method_span = if path.segments.len() >= 2 {
path.segments.last().map(|s| s.ident.span)
} else {
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)
}
Expand Down

0 comments on commit 957e2ef

Please sign in to comment.