Struct rustc_plugin::registry::Registry
[−]
[src]
pub struct Registry<'a> {
pub sess: &'a Session,
// some fields omitted
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Structure used to register plugins.
A plugin registrar function takes an &mut Registry and should call
methods to register its plugins.
This struct has public fields and other methods for use by rustc
itself. They are not documented here, and plugin authors should
not use them.
Fields
sess: &'a Session
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Compiler session. Useful if you want to emit diagnostic messages from the plugin registrar.
Methods
impl<'a> Registry<'a>[src]
impl<'a> Registry<'a>pub fn args<'b>(&'b self) -> &'b [NestedMetaItem][src]
pub fn args<'b>(&'b self) -> &'b [NestedMetaItem]🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Get the plugin's arguments, if any.
These are specified inside the plugin crate attribute as
#![plugin(my_plugin_name(... args ...))]
Returns empty slice in case the plugin was loaded
with --extra-plugins
pub fn register_syntax_extension(
&mut self,
name: Name,
extension: SyntaxExtension
)[src]
pub fn register_syntax_extension(
&mut self,
name: Name,
extension: SyntaxExtension
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register a syntax extension of any kind.
This is the most general hook into libsyntax's expansion behavior.
pub fn register_custom_derive(&mut self, name: Name, extension: SyntaxExtension)[src]
pub fn register_custom_derive(&mut self, name: Name, extension: SyntaxExtension): replaced by macros 1.1 (RFC 1861)
rustc_private)This can be used in place of register_syntax_extension to register legacy custom derives
(i.e. attribute syntax extensions whose name begins with derive_). Legacy custom
derives defined by this function do not trigger deprecation warnings when used.
pub fn take_whitelisted_custom_derives(&mut self) -> Vec<Name>[src]
pub fn take_whitelisted_custom_derives(&mut self) -> Vec<Name>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
pub fn register_macro(&mut self, name: &str, expander: MacroExpanderFn)[src]
pub fn register_macro(&mut self, name: &str, expander: MacroExpanderFn)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register a macro of the usual kind.
This is a convenience wrapper for register_syntax_extension.
It builds for you a NormalTT that calls expander,
and also takes care of interning the macro's name.
pub fn register_early_lint_pass(&mut self, lint_pass: EarlyLintPassObject)[src]
pub fn register_early_lint_pass(&mut self, lint_pass: EarlyLintPassObject)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register a compiler lint pass.
pub fn register_late_lint_pass(&mut self, lint_pass: LateLintPassObject)[src]
pub fn register_late_lint_pass(&mut self, lint_pass: LateLintPassObject)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register a compiler lint pass.
pub fn register_lint_group(
&mut self,
name: &'static str,
to: Vec<&'static Lint>
)[src]
pub fn register_lint_group(
&mut self,
name: &'static str,
to: Vec<&'static Lint>
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register a lint group.
pub fn register_llvm_pass(&mut self, name: &str)[src]
pub fn register_llvm_pass(&mut self, name: &str)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register an LLVM pass.
Registration with LLVM itself is handled through static C++ objects with constructors. This method simply adds a name to the list of passes to execute.
pub fn register_attribute(&mut self, name: String, ty: AttributeType)[src]
pub fn register_attribute(&mut self, name: String, ty: AttributeType)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Register an attribute with an attribute type.
Registered attributes will bypass the custom_attribute feature gate.
Whitelisted attributes will additionally not trigger the unused_attribute
lint. CrateLevel attributes will not be allowed on anything other than a crate.