Skip to content

Commit

Permalink
Fix issues and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Jun 1, 2021
1 parent 69a19bf commit 4675690
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl<'s> LintLevelsBuilder<'s> {
LintLevelSource::Default => false,
LintLevelSource::Node(symbol, _, _) => self.store.is_lint_group(symbol),
LintLevelSource::CommandLine(symbol, _) => self.store.is_lint_group(symbol),
LintLevelSource::ForceWarn(symbol) => {
LintLevelSource::ForceWarn(_symbol) => {
bug!("forced warn lint returned a forbid lint level")
}
};
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/lint.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::cmp;

use crate::ich::StableHashingContext;
use chalk_ir::Substitution;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_errors::{DiagnosticBuilder, DiagnosticId};
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/force-warn/force-allowed-group.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// compile-flags: --force-warns bare_trait_objects
// check-pass

#![allow(rust_2018_compatibility)]
#![allow(rust_2018_idioms)]

pub trait SomeTrait {}

Expand Down
13 changes: 13 additions & 0 deletions src/test/ui/lint/force-warn/force-warn-group.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// ignore-test
// compile-flags: --force-warns rust_2018_idioms
// check-pass

#![allow(rust_2018_idioms)]

pub trait SomeTrait {}

pub fn function(_x: Box<SomeTrait>) {}
//~^ WARN trait objects without an explicit `dyn` are deprecated
//~| WARN this was previously accepted by the compiler

fn main() {}

0 comments on commit 4675690

Please sign in to comment.