Skip to content

Commit 46753da

Browse files
committed
Record correct span for static mut items
1 parent 67dfc17 commit 46753da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_trans/save/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,12 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
520520
let qualname = format!("::{}", self.analysis.ty_cx.map.path_to_string(item.id));
521521

522522
// If the variable is immutable, save the initialising expression.
523-
let value = match mt {
524-
ast::MutMutable => String::from_str("<mutable>"),
525-
ast::MutImmutable => self.span.snippet(expr.span),
523+
let (value, keyword) = match mt {
524+
ast::MutMutable => (String::from_str("<mutable>"), keywords::Mut),
525+
ast::MutImmutable => (self.span.snippet(expr.span), keywords::Static),
526526
};
527527

528-
let sub_span = self.span.sub_span_after_keyword(item.span, keywords::Static);
528+
let sub_span = self.span.sub_span_after_keyword(item.span, keyword);
529529
self.fmt.static_str(item.span,
530530
sub_span,
531531
item.id,

0 commit comments

Comments
 (0)