diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-09-29 10:11:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-29 10:11:13 +0200 |
| commit | 0c4501847394fd89d9fb39ee601e1ae6bb9da264 (patch) | |
| tree | 726da47f617c65b17b2250582f4d29ec6d133bf6 /src | |
| parent | e814f1e3c0188ea8fc583bc35a63d2c7d9935c17 (diff) | |
| parent | f1b74841602617633a9f731f5a5b20ae7d3ed117 (diff) | |
| download | rust-0c4501847394fd89d9fb39ee601e1ae6bb9da264.tar.gz rust-0c4501847394fd89d9fb39ee601e1ae6bb9da264.zip | |
Rollup merge of #116231 - DaniPopes:simpler-lint-array, r=Nilstrieb
Remove `rustc_lint_defs::lint_array`
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/plugin.md | 10 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/doc/unstable-book/src/language-features/plugin.md b/src/doc/unstable-book/src/language-features/plugin.md index 1fade6ce95b..189cc910a8d 100644 --- a/src/doc/unstable-book/src/language-features/plugin.md +++ b/src/doc/unstable-book/src/language-features/plugin.md @@ -43,14 +43,14 @@ extern crate rustc_ast; // Load rustc as a plugin to get macros extern crate rustc_driver; -#[macro_use] extern crate rustc_lint; #[macro_use] extern crate rustc_session; -use rustc_driver::plugin::Registry; -use rustc_lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; use rustc_ast::ast; +use rustc_driver::plugin::Registry; +use rustc_lint::{EarlyContext, EarlyLintPass, LintContext}; + declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'"); declare_lint_pass!(Pass => [TEST_LINT]); @@ -58,9 +58,7 @@ declare_lint_pass!(Pass => [TEST_LINT]); impl EarlyLintPass for Pass { fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) { if it.ident.name.as_str() == "lintme" { - cx.lint(TEST_LINT, |lint| { - lint.build("item is named 'lintme'").set_span(it.span).emit() - }); + cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span)); } } } diff --git a/src/tools/clippy/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs b/src/tools/clippy/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs index 87380f14f9a..bbb5ade8b9f 100644 --- a/src/tools/clippy/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs +++ b/src/tools/clippy/clippy_lints/src/utils/internal_lints/lint_without_lint_pass.rs @@ -28,8 +28,8 @@ declare_clippy_lint! { /// know the name of the lint. /// /// ### Known problems - /// Only checks for lints associated using the - /// `declare_lint_pass!`, `impl_lint_pass!`, and `lint_array!` macros. + /// Only checks for lints associated using the `declare_lint_pass!` and + /// `impl_lint_pass!` macros. /// /// ### Example /// ```rust,ignore |
