2014-11-26 02:17:11 +00:00
|
|
|
//! Infrastructure for compiler plugins.
|
|
|
|
//!
|
2019-11-22 20:06:56 +00:00
|
|
|
//! Plugins are a deprecated way to extend the behavior of `rustc` in various ways.
|
2014-11-26 02:17:11 +00:00
|
|
|
//!
|
2019-04-20 07:45:47 +00:00
|
|
|
//! See the [`plugin`
|
|
|
|
//! feature](https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html)
|
2019-11-22 20:06:56 +00:00
|
|
|
//! of the Unstable Book for some examples.
|
2014-05-26 21:48:54 +00:00
|
|
|
|
2020-09-23 19:51:56 +00:00
|
|
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
2020-08-08 02:05:10 +00:00
|
|
|
#![recursion_limit = "256"]
|
2022-08-19 17:29:33 +00:00
|
|
|
#![deny(rustc::untranslatable_diagnostic)]
|
|
|
|
#![deny(rustc::diagnostic_outside_of_impl)]
|
2017-05-08 21:36:44 +00:00
|
|
|
|
2022-10-13 09:13:02 +00:00
|
|
|
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
2023-04-16 12:33:00 +00:00
|
|
|
use rustc_fluent_macro::fluent_messages;
|
2020-01-09 06:52:01 +00:00
|
|
|
use rustc_lint::LintStore;
|
2018-12-13 15:57:25 +00:00
|
|
|
|
2022-08-19 17:29:33 +00:00
|
|
|
mod errors;
|
2019-11-30 12:35:25 +00:00
|
|
|
pub mod load;
|
|
|
|
|
2023-03-02 23:18:38 +00:00
|
|
|
fluent_messages! { "../messages.ftl" }
|
2022-10-13 09:13:02 +00:00
|
|
|
|
2019-11-30 12:35:25 +00:00
|
|
|
/// Structure used to register plugins.
|
|
|
|
///
|
|
|
|
/// A plugin registrar function takes an `&mut Registry` and should call
|
|
|
|
/// methods to register its plugins.
|
|
|
|
pub struct Registry<'a> {
|
|
|
|
/// The `LintStore` allows plugins to register new lints.
|
|
|
|
pub lint_store: &'a mut LintStore,
|
|
|
|
}
|