1
Fork 0

rustc_lint: Prevent multiple 'incompatible with previous forbid' lints

This commit is contained in:
Martin Nordholts 2023-12-28 18:28:06 +01:00
parent e0c626fbbc
commit 741884dab2
15 changed files with 8 additions and 204 deletions

View file

@ -642,7 +642,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
//
// This means that this only errors if we're truly lowering the lint
// level from forbid.
if level != Level::Forbid {
if self.lint_added_lints && level != Level::Forbid {
if let Level::Forbid = old_level {
// Backwards compatibility check:
//