Skip to content

Commit bac672c

Browse files
Remove now-incorrect code
Because our lint infra *can* handle allows from within macro expansions! (Also, what did this reason have to do with something that is a hard error and not a lint? I'm puzzled). I wonder how many such diagnostics we have... Maybe that also mean we can change `unused_mut` to no-longer-experimental? But this is a change I'm afraid to do without checking.
1 parent d2c7e0f commit bac672c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/mutability_errors.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ use crate::{fix, Diagnostic, DiagnosticCode, DiagnosticsContext};
88
//
99
// This diagnostic is triggered on mutating an immutable variable.
1010
pub(crate) fn need_mut(ctx: &DiagnosticsContext<'_>, d: &hir::NeedMut) -> Option<Diagnostic> {
11-
if d.span.file_id.macro_file().is_some() {
12-
// FIXME: Our infra can't handle allow from within macro expansions rn
13-
return None;
14-
}
1511
let fixes = (|| {
1612
if d.local.is_ref(ctx.sema.db) {
1713
// There is no simple way to add `mut` to `ref x` and `ref mut x`
@@ -53,10 +49,6 @@ pub(crate) fn need_mut(ctx: &DiagnosticsContext<'_>, d: &hir::NeedMut) -> Option
5349
// This diagnostic is triggered when a mutable variable isn't actually mutated.
5450
pub(crate) fn unused_mut(ctx: &DiagnosticsContext<'_>, d: &hir::UnusedMut) -> Option<Diagnostic> {
5551
let ast = d.local.primary_source(ctx.sema.db).syntax_ptr();
56-
if ast.file_id.macro_file().is_some() {
57-
// FIXME: Our infra can't handle allow from within macro expansions rn
58-
return None;
59-
}
6052
let fixes = (|| {
6153
let file_id = ast.file_id.file_id()?;
6254
let mut edit_builder = TextEdit::builder();

0 commit comments

Comments
 (0)