Skip to content

Commit

Permalink
Fix docs, fix incorrect lint source in note
Browse files Browse the repository at this point in the history
  • Loading branch information
David Koloski committed Mar 8, 2022
1 parent 1593ce8 commit fa10d90
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_lint/src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,10 +601,11 @@ impl<'s> LintLevelsBuilder<'s> {
fn check_gated_lint(&self, lint_id: LintId, span: Span) -> bool {
if let Some(feature) = lint_id.lint.feature_gate {
if !self.sess.features_untracked().enabled(feature) {
let lint = builtin::UNKNOWN_LINTS;
let (level, src) = self.lint_level(builtin::UNKNOWN_LINTS);
struct_lint_level(self.sess, lint_id.lint, level, src, Some(span.into()), |lint| {
struct_lint_level(self.sess, lint, level, src, Some(span.into()), |lint_db| {
let mut db =
lint.build(&format!("unknown lint: `{}`", lint_id.lint.name_lower()));
lint_db.build(&format!("unknown lint: `{}`", lint_id.lint.name_lower()));
db.note(&format!("the `{}` lint is unstable", lint_id.lint.name_lower(),));
add_feature_diagnostics(&mut db, &self.sess.parse_sess, feature);
db.emit();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3786,7 +3786,7 @@ declare_lint! {
///
/// ### Explanation
///
/// In order to test the behavior of unstable traits, a permanently-unstable
/// In order to test the behavior of unstable lints, a permanently-unstable
/// lint is required. This lint can be used to trigger warnings and errors
/// from the compiler related to unstable lints.
pub TEST_UNSTABLE_LINT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: unknown lint: `non_exhaustive_omitted_patterns`
LL | #![deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(non_exhaustive_omitted_patterns)]` on by default
= note: `#[warn(unknown_lints)]` on by default
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: unknown lint: `test_unstable_lint`
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(test_unstable_lint)]` on by default
= note: `#[warn(unknown_lints)]` on by default
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/must_not_suspend/gated.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ warning: unknown lint: `must_not_suspend`
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(must_not_suspend)]` on by default
= note: `#[warn(unknown_lints)]` on by default
= note: the `must_not_suspend` lint is unstable
= note: see issue #83310 <https://github.com/rust-lang/rust/issues/83310> for more information
= help: add `#![feature(must_not_suspend)]` to the crate attributes to enable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: unknown lint: `test_unstable_lint`
|
= note: `-D test-unstable-lint` implied by `-D unknown-lints`
= note: requested on the command line with `-D unknown-lints`
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ note: the lint level is defined here
|
LL | #![deny(unknown_lints)]
| ^^^^^^^^^^^^^
= note: `#[deny(test_unstable_lint)]` implied by `#[deny(unknown_lints)]`
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
warning: unknown lint: `test_unstable_lint`
|
= note: `-W test-unstable-lint` implied by `-W unknown-lints`
= note: requested on the command line with `-W unknown-lints`
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ note: the lint level is defined here
|
LL | #![warn(unknown_lints)]
| ^^^^^^^^^^^^^
= note: `#[warn(test_unstable_lint)]` implied by `#[warn(unknown_lints)]`
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable

Expand Down

0 comments on commit fa10d90

Please sign in to comment.