diff options
| author | David Koloski <dkoloski@google.com> | 2022-03-02 00:10:39 +0000 |
|---|---|---|
| committer | David Koloski <dkoloski@google.com> | 2022-03-08 19:09:32 +0000 |
| commit | fa10d90b9974844790b0ad98fa5c50fae80ee166 (patch) | |
| tree | 0328b386d1437c8481d43507e7db775b5831638f /compiler | |
| parent | 1593ce8609714f4717a9db964507bf4fdf1e400d (diff) | |
| download | rust-fa10d90b9974844790b0ad98fa5c50fae80ee166.tar.gz rust-fa10d90b9974844790b0ad98fa5c50fae80ee166.zip | |
Fix docs, fix incorrect lint source in note
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/levels.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/levels.rs b/compiler/rustc_lint/src/levels.rs index 2b28fc2c011..7b018e7f75f 100644 --- a/compiler/rustc_lint/src/levels.rs +++ b/compiler/rustc_lint/src/levels.rs @@ -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(); diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 7f1591a7212..62eba796eae 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -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, |
