Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 957c07f

Browse files
committedMay 17, 2024
Update all lint diagnostics to store their span
1 parent 115ead1 commit 957c07f

File tree

78 files changed

+1312
-930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1312
-930
lines changed
 

Diff for: ‎compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ fn do_mir_borrowck<'tcx>(
409409

410410
let mut_span = tcx.sess.source_map().span_until_non_whitespace(span);
411411

412-
tcx.emit_node_span_lint(UNUSED_MUT, lint_root, span, VarNeedNotMut { span: mut_span })
412+
tcx.emit_node_lint(UNUSED_MUT, lint_root, VarNeedNotMut { span, mut_span })
413413
}
414414

415415
let tainted_by_errors = mbcx.emit_errors();

Diff for: ‎compiler/rustc_borrowck/src/session_diagnostics.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ pub(crate) struct GenericDoesNotLiveLongEnough {
4949
#[derive(LintDiagnostic)]
5050
#[diag(borrowck_var_does_not_need_mut)]
5151
pub(crate) struct VarNeedNotMut {
52-
#[suggestion(style = "short", applicability = "machine-applicable", code = "")]
52+
#[primary_span]
5353
pub span: Span,
54+
#[suggestion(style = "short", applicability = "machine-applicable", code = "")]
55+
pub mut_span: Span,
5456
}
5557
#[derive(Diagnostic)]
5658
#[diag(borrowck_var_cannot_escape_closure)]

0 commit comments

Comments
 (0)
Please sign in to comment.