• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //! Infrastructure for compiler plugins.
2 //!
3 //! Plugins are a deprecated way to extend the behavior of `rustc` in various ways.
4 //!
5 //! See the [`plugin`
6 //! feature](https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html)
7 //! of the Unstable Book for some examples.
8 
9 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
10 #![recursion_limit = "256"]
11 #![deny(rustc::untranslatable_diagnostic)]
12 #![deny(rustc::diagnostic_outside_of_impl)]
13 
14 use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
15 use rustc_fluent_macro::fluent_messages;
16 use rustc_lint::LintStore;
17 
18 mod errors;
19 pub mod load;
20 
21 fluent_messages! { "../messages.ftl" }
22 
23 /// Structure used to register plugins.
24 ///
25 /// A plugin registrar function takes an `&mut Registry` and should call
26 /// methods to register its plugins.
27 pub struct Registry<'a> {
28     /// The `LintStore` allows plugins to register new lints.
29     pub lint_store: &'a mut LintStore,
30 }
31