1
Fork 0

Remove is_lint field from Level::Error.

Because it's redundant w.r.t. `Diagnostic::is_lint`, which is present
for every diagnostic level.

`struct_lint_level_impl` was the only place that set the `Error` field
to `true`, and it's also the only place that calls
`Diagnostic::is_lint()` to set the `is_lint` field.
This commit is contained in:
Nicholas Nethercote 2024-01-04 11:44:37 +11:00
parent 8e6bca63f9
commit 8388112970
9 changed files with 20 additions and 28 deletions

View file

@ -395,7 +395,7 @@ fn not_testable_error(cx: &ExtCtxt<'_>, attr_sp: Span, item: Option<&ast::Item>)
// These were a warning before #92959 and need to continue being that to avoid breaking
// stable user code (#94508).
Some(ast::ItemKind::MacCall(_)) => Level::Warning(None),
_ => Level::Error { lint: false },
_ => Level::Error,
};
let mut err = DiagnosticBuilder::<()>::new(dcx, level, msg);
err.span(attr_sp);