Rename rustc_middle::lint::LevelSource
to LevelAndSource
This commit is contained in:
parent
fe531d5a5f
commit
2e3ab43f5c
2 changed files with 10 additions and 10 deletions
|
@ -10,7 +10,7 @@ use rustc_hir as hir;
|
||||||
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
|
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
|
||||||
use rustc_hir::{intravisit, HirId};
|
use rustc_hir::{intravisit, HirId};
|
||||||
use rustc_middle::hir::map::Map;
|
use rustc_middle::hir::map::Map;
|
||||||
use rustc_middle::lint::LevelSource;
|
use rustc_middle::lint::LevelAndSource;
|
||||||
use rustc_middle::lint::LintDiagnosticBuilder;
|
use rustc_middle::lint::LintDiagnosticBuilder;
|
||||||
use rustc_middle::lint::{
|
use rustc_middle::lint::{
|
||||||
struct_lint_level, LintLevelMap, LintLevelSets, LintLevelSource, LintSet,
|
struct_lint_level, LintLevelMap, LintLevelSets, LintLevelSource, LintSet,
|
||||||
|
@ -106,9 +106,9 @@ impl<'s> LintLevelsBuilder<'s> {
|
||||||
/// diagnostic with no change to `specs`.
|
/// diagnostic with no change to `specs`.
|
||||||
fn insert_spec(
|
fn insert_spec(
|
||||||
&mut self,
|
&mut self,
|
||||||
specs: &mut FxHashMap<LintId, LevelSource>,
|
specs: &mut FxHashMap<LintId, LevelAndSource>,
|
||||||
id: LintId,
|
id: LintId,
|
||||||
(level, src): LevelSource,
|
(level, src): LevelAndSource,
|
||||||
) {
|
) {
|
||||||
// Setting to a non-forbid level is an error if the lint previously had
|
// Setting to a non-forbid level is an error if the lint previously had
|
||||||
// a forbid level. Note that this is not necessarily true even with a
|
// a forbid level. Note that this is not necessarily true even with a
|
||||||
|
|
|
@ -46,7 +46,7 @@ impl LintLevelSource {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A tuple of a lint level and its source.
|
/// A tuple of a lint level and its source.
|
||||||
pub type LevelSource = (Level, LintLevelSource);
|
pub type LevelAndSource = (Level, LintLevelSource);
|
||||||
|
|
||||||
pub struct LintLevelSets {
|
pub struct LintLevelSets {
|
||||||
pub list: Vec<LintSet>,
|
pub list: Vec<LintSet>,
|
||||||
|
@ -57,11 +57,11 @@ pub enum LintSet {
|
||||||
CommandLine {
|
CommandLine {
|
||||||
// -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
|
// -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
|
||||||
// flag.
|
// flag.
|
||||||
specs: FxHashMap<LintId, LevelSource>,
|
specs: FxHashMap<LintId, LevelAndSource>,
|
||||||
},
|
},
|
||||||
|
|
||||||
Node {
|
Node {
|
||||||
specs: FxHashMap<LintId, LevelSource>,
|
specs: FxHashMap<LintId, LevelAndSource>,
|
||||||
parent: u32,
|
parent: u32,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ impl LintLevelSets {
|
||||||
&self,
|
&self,
|
||||||
lint: &'static Lint,
|
lint: &'static Lint,
|
||||||
idx: u32,
|
idx: u32,
|
||||||
aux: Option<&FxHashMap<LintId, LevelSource>>,
|
aux: Option<&FxHashMap<LintId, LevelAndSource>>,
|
||||||
sess: &Session,
|
sess: &Session,
|
||||||
) -> LevelSource {
|
) -> LevelAndSource {
|
||||||
let (level, mut src) = self.get_lint_id_level(LintId::of(lint), idx, aux);
|
let (level, mut src) = self.get_lint_id_level(LintId::of(lint), idx, aux);
|
||||||
|
|
||||||
// If `level` is none then we actually assume the default level for this
|
// If `level` is none then we actually assume the default level for this
|
||||||
|
@ -113,7 +113,7 @@ impl LintLevelSets {
|
||||||
&self,
|
&self,
|
||||||
id: LintId,
|
id: LintId,
|
||||||
mut idx: u32,
|
mut idx: u32,
|
||||||
aux: Option<&FxHashMap<LintId, LevelSource>>,
|
aux: Option<&FxHashMap<LintId, LevelAndSource>>,
|
||||||
) -> (Option<Level>, LintLevelSource) {
|
) -> (Option<Level>, LintLevelSource) {
|
||||||
if let Some(specs) = aux {
|
if let Some(specs) = aux {
|
||||||
if let Some(&(level, src)) = specs.get(&id) {
|
if let Some(&(level, src)) = specs.get(&id) {
|
||||||
|
@ -157,7 +157,7 @@ impl LintLevelMap {
|
||||||
lint: &'static Lint,
|
lint: &'static Lint,
|
||||||
id: HirId,
|
id: HirId,
|
||||||
session: &Session,
|
session: &Session,
|
||||||
) -> Option<LevelSource> {
|
) -> Option<LevelAndSource> {
|
||||||
self.id_to_set.get(&id).map(|idx| self.sets.get_lint_level(lint, *idx, None, session))
|
self.id_to_set.get(&id).map(|idx| self.sets.get_lint_level(lint, *idx, None, session))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue