Fix docs, fix incorrect lint source in note
This commit is contained in:
parent
1593ce8609
commit
fa10d90b99
9 changed files with 9 additions and 10 deletions
|
@ -601,10 +601,11 @@ impl<'s> LintLevelsBuilder<'s> {
|
||||||
fn check_gated_lint(&self, lint_id: LintId, span: Span) -> bool {
|
fn check_gated_lint(&self, lint_id: LintId, span: Span) -> bool {
|
||||||
if let Some(feature) = lint_id.lint.feature_gate {
|
if let Some(feature) = lint_id.lint.feature_gate {
|
||||||
if !self.sess.features_untracked().enabled(feature) {
|
if !self.sess.features_untracked().enabled(feature) {
|
||||||
|
let lint = builtin::UNKNOWN_LINTS;
|
||||||
let (level, src) = self.lint_level(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 =
|
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(),));
|
db.note(&format!("the `{}` lint is unstable", lint_id.lint.name_lower(),));
|
||||||
add_feature_diagnostics(&mut db, &self.sess.parse_sess, feature);
|
add_feature_diagnostics(&mut db, &self.sess.parse_sess, feature);
|
||||||
db.emit();
|
db.emit();
|
||||||
|
|
|
@ -3786,7 +3786,7 @@ declare_lint! {
|
||||||
///
|
///
|
||||||
/// ### Explanation
|
/// ### 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
|
/// lint is required. This lint can be used to trigger warnings and errors
|
||||||
/// from the compiler related to unstable lints.
|
/// from the compiler related to unstable lints.
|
||||||
pub TEST_UNSTABLE_LINT,
|
pub TEST_UNSTABLE_LINT,
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unknown lint: `non_exhaustive_omitted_patterns`
|
||||||
LL | #![deny(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: the `non_exhaustive_omitted_patterns` lint is unstable
|
||||||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
|
= 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
|
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unknown lint: `test_unstable_lint`
|
||||||
LL | #![allow(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
|
= note: the `test_unstable_lint` lint is unstable
|
||||||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ warning: unknown lint: `must_not_suspend`
|
||||||
LL | #![deny(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: the `must_not_suspend` lint is unstable
|
||||||
= note: see issue #83310 <https://github.com/rust-lang/rust/issues/83310> for more information
|
= 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
|
= help: add `#![feature(must_not_suspend)]` to the crate attributes to enable
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
error: unknown lint: `test_unstable_lint`
|
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
|
= note: the `test_unstable_lint` lint is unstable
|
||||||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ note: the lint level is defined here
|
||||||
|
|
|
|
||||||
LL | #![deny(unknown_lints)]
|
LL | #![deny(unknown_lints)]
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
= note: `#[deny(test_unstable_lint)]` implied by `#[deny(unknown_lints)]`
|
|
||||||
= note: the `test_unstable_lint` lint is unstable
|
= note: the `test_unstable_lint` lint is unstable
|
||||||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
warning: unknown lint: `test_unstable_lint`
|
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
|
= note: the `test_unstable_lint` lint is unstable
|
||||||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ note: the lint level is defined here
|
||||||
|
|
|
|
||||||
LL | #![warn(unknown_lints)]
|
LL | #![warn(unknown_lints)]
|
||||||
| ^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^
|
||||||
= note: `#[warn(test_unstable_lint)]` implied by `#[warn(unknown_lints)]`
|
|
||||||
= note: the `test_unstable_lint` lint is unstable
|
= note: the `test_unstable_lint` lint is unstable
|
||||||
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue