Skip to content

Commit 4675690

Browse files
committed
Fix issues and add test
1 parent 69a19bf commit 4675690

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

compiler/rustc_lint/src/levels.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'s> LintLevelsBuilder<'s> {
147147
LintLevelSource::Default => false,
148148
LintLevelSource::Node(symbol, _, _) => self.store.is_lint_group(symbol),
149149
LintLevelSource::CommandLine(symbol, _) => self.store.is_lint_group(symbol),
150-
LintLevelSource::ForceWarn(symbol) => {
150+
LintLevelSource::ForceWarn(_symbol) => {
151151
bug!("forced warn lint returned a forbid lint level")
152152
}
153153
};

compiler/rustc_middle/src/lint.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::cmp;
22

33
use crate::ich::StableHashingContext;
4-
use chalk_ir::Substitution;
54
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
65
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
76
use rustc_errors::{DiagnosticBuilder, DiagnosticId};

src/test/ui/lint/force-warn/force-allowed-group.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// compile-flags: --force-warns bare_trait_objects
22
// check-pass
33

4-
#![allow(rust_2018_compatibility)]
4+
#![allow(rust_2018_idioms)]
55

66
pub trait SomeTrait {}
77

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// ignore-test
2+
// compile-flags: --force-warns rust_2018_idioms
3+
// check-pass
4+
5+
#![allow(rust_2018_idioms)]
6+
7+
pub trait SomeTrait {}
8+
9+
pub fn function(_x: Box<SomeTrait>) {}
10+
//~^ WARN trait objects without an explicit `dyn` are deprecated
11+
//~| WARN this was previously accepted by the compiler
12+
13+
fn main() {}

0 commit comments

Comments
 (0)