Fix issues and add test

This commit is contained in:
Ryan Levick 2021-06-01 18:01:13 +02:00
parent 69a19bfd43
commit 4675690ac4
4 changed files with 15 additions and 3 deletions

View File

@ -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")
}
};

View File

@ -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};

View File

@ -1,7 +1,7 @@
// compile-flags: --force-warns bare_trait_objects
// check-pass
#![allow(rust_2018_compatibility)]
#![allow(rust_2018_idioms)]
pub trait SomeTrait {}

View File

@ -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() {}