You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for a full example, the core of which is reproduced here:
173
+
code style, safety, etc. Now let's write a plugin [`lint_plugin_test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/auxiliary/lint_plugin_test.rs)
174
+
that warns about any item named `lintme`.
176
175
177
176
```ignore
178
-
declare_lint!(TEST_LINT, Warn,
179
-
"Warn about items named 'lintme'");
177
+
#![feature(plugin_registrar)]
178
+
#![feature(box_syntax, rustc_private)]
179
+
180
+
extern crate syntax;
181
+
182
+
// Load rustc as a plugin to get macros
183
+
#[macro_use]
184
+
extern crate rustc;
185
+
186
+
use rustc::lint::{EarlyContext, LintContext, LintPass, EarlyLintPass,
187
+
EarlyLintPassObject, LintArray};
188
+
use rustc::plugin::Registry;
189
+
use syntax::ast;
190
+
191
+
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
0 commit comments