Skip to content

Commit fa10d90

Browse files
author
David Koloski
committed
Fix docs, fix incorrect lint source in note
1 parent 1593ce8 commit fa10d90

9 files changed

+9
-10
lines changed

compiler/rustc_lint/src/levels.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,11 @@ impl<'s> LintLevelsBuilder<'s> {
601601
fn check_gated_lint(&self, lint_id: LintId, span: Span) -> bool {
602602
if let Some(feature) = lint_id.lint.feature_gate {
603603
if !self.sess.features_untracked().enabled(feature) {
604+
let lint = builtin::UNKNOWN_LINTS;
604605
let (level, src) = self.lint_level(builtin::UNKNOWN_LINTS);
605-
struct_lint_level(self.sess, lint_id.lint, level, src, Some(span.into()), |lint| {
606+
struct_lint_level(self.sess, lint, level, src, Some(span.into()), |lint_db| {
606607
let mut db =
607-
lint.build(&format!("unknown lint: `{}`", lint_id.lint.name_lower()));
608+
lint_db.build(&format!("unknown lint: `{}`", lint_id.lint.name_lower()));
608609
db.note(&format!("the `{}` lint is unstable", lint_id.lint.name_lower(),));
609610
add_feature_diagnostics(&mut db, &self.sess.parse_sess, feature);
610611
db.emit();

compiler/rustc_lint_defs/src/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3786,7 +3786,7 @@ declare_lint! {
37863786
///
37873787
/// ### Explanation
37883788
///
3789-
/// In order to test the behavior of unstable traits, a permanently-unstable
3789+
/// In order to test the behavior of unstable lints, a permanently-unstable
37903790
/// lint is required. This lint can be used to trigger warnings and errors
37913791
/// from the compiler related to unstable lints.
37923792
pub TEST_UNSTABLE_LINT,

src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unknown lint: `non_exhaustive_omitted_patterns`
44
LL | #![deny(non_exhaustive_omitted_patterns)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(non_exhaustive_omitted_patterns)]` on by default
7+
= note: `#[warn(unknown_lints)]` on by default
88
= note: the `non_exhaustive_omitted_patterns` lint is unstable
99
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
1010
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable

src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unknown lint: `test_unstable_lint`
44
LL | #![allow(test_unstable_lint)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(test_unstable_lint)]` on by default
7+
= note: `#[warn(unknown_lints)]` on by default
88
= note: the `test_unstable_lint` lint is unstable
99
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
1010

src/test/ui/lint/must_not_suspend/gated.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unknown lint: `must_not_suspend`
44
LL | #![deny(must_not_suspend)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: `#[warn(must_not_suspend)]` on by default
7+
= note: `#[warn(unknown_lints)]` on by default
88
= note: the `must_not_suspend` lint is unstable
99
= note: see issue #83310 <https://github.com/rust-lang/rust/issues/83310> for more information
1010
= help: add `#![feature(must_not_suspend)]` to the crate attributes to enable

src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
error: unknown lint: `test_unstable_lint`
22
|
3-
= note: `-D test-unstable-lint` implied by `-D unknown-lints`
3+
= note: requested on the command line with `-D unknown-lints`
44
= note: the `test_unstable_lint` lint is unstable
55
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
66

src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(unknown_lints)]
1111
| ^^^^^^^^^^^^^
12-
= note: `#[deny(test_unstable_lint)]` implied by `#[deny(unknown_lints)]`
1312
= note: the `test_unstable_lint` lint is unstable
1413
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
1514

src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr

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

src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ note: the lint level is defined here
99
|
1010
LL | #![warn(unknown_lints)]
1111
| ^^^^^^^^^^^^^
12-
= note: `#[warn(test_unstable_lint)]` implied by `#[warn(unknown_lints)]`
1312
= note: the `test_unstable_lint` lint is unstable
1413
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
1514

0 commit comments

Comments
 (0)