Skip to content

Commit eef02c4

Browse files
committed
rustc_lint: Rename warn_about_weird_lints to lint_added_lints
So we can apply more kinds of lints to added lints without having to add another parameter.
1 parent a4bcd47 commit eef02c4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

compiler/rustc_lint/src/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ impl<'a> EarlyContext<'a> {
10691069
pub(crate) fn new(
10701070
sess: &'a Session,
10711071
features: &'a Features,
1072-
warn_about_weird_lints: bool,
1072+
lint_added_lints: bool,
10731073
lint_store: &'a LintStore,
10741074
registered_tools: &'a RegisteredTools,
10751075
buffered: LintBuffer,
@@ -1078,7 +1078,7 @@ impl<'a> EarlyContext<'a> {
10781078
builder: LintLevelsBuilder::new(
10791079
sess,
10801080
features,
1081-
warn_about_weird_lints,
1081+
lint_added_lints,
10821082
lint_store,
10831083
registered_tools,
10841084
),

compiler/rustc_lint/src/levels.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn lint_expectations(tcx: TyCtxt<'_>, (): ()) -> Vec<(LintExpectationId, LintExp
135135
unstable_to_stable_ids: FxHashMap::default(),
136136
empty: FxHashMap::default(),
137137
},
138-
warn_about_weird_lints: false,
138+
lint_added_lints: false,
139139
store,
140140
registered_tools: tcx.registered_tools(()),
141141
};
@@ -164,7 +164,7 @@ fn shallow_lint_levels_on(tcx: TyCtxt<'_>, owner: hir::OwnerId) -> ShallowLintLe
164164
empty: FxHashMap::default(),
165165
attrs,
166166
},
167-
warn_about_weird_lints: false,
167+
lint_added_lints: false,
168168
store,
169169
registered_tools: tcx.registered_tools(()),
170170
};
@@ -451,7 +451,7 @@ pub struct LintLevelsBuilder<'s, P> {
451451
sess: &'s Session,
452452
features: &'s Features,
453453
provider: P,
454-
warn_about_weird_lints: bool,
454+
lint_added_lints: bool,
455455
store: &'s LintStore,
456456
registered_tools: &'s RegisteredTools,
457457
}
@@ -464,15 +464,15 @@ impl<'s> LintLevelsBuilder<'s, TopDown> {
464464
pub(crate) fn new(
465465
sess: &'s Session,
466466
features: &'s Features,
467-
warn_about_weird_lints: bool,
467+
lint_added_lints: bool,
468468
store: &'s LintStore,
469469
registered_tools: &'s RegisteredTools,
470470
) -> Self {
471471
let mut builder = LintLevelsBuilder {
472472
sess,
473473
features,
474474
provider: TopDown { sets: LintLevelSets::new(), cur: COMMAND_LINE },
475-
warn_about_weird_lints,
475+
lint_added_lints,
476476
store,
477477
registered_tools,
478478
};
@@ -968,7 +968,7 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
968968
continue;
969969
}
970970

971-
_ if !self.warn_about_weird_lints => {}
971+
_ if !self.lint_added_lints => {}
972972

973973
CheckLintNameResult::Renamed(ref replace) => {
974974
let suggestion =

0 commit comments

Comments
 (0)