[][src]Struct rustc_plugin::registry::Registry

pub struct Registry<'a> {
    pub sess: &'a Session,
    pub args_hidden: Option<Vec<NestedMetaItem>>,
    pub krate_span: Span,
    pub syntax_exts: Vec<NamedSyntaxExtension>,
    pub early_lint_passes: Vec<EarlyLintPassObject>,
    pub late_lint_passes: Vec<LateLintPassObject>,
    pub lint_groups: FxHashMap<&'static str, (Vec<LintId>, Option<&'static str>)>,
    pub llvm_passes: Vec<String>,
    pub attributes: Vec<(String, AttributeType)>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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 an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Compiler session. Useful if you want to emit diagnostic messages from the plugin registrar.

args_hidden: Option<Vec<NestedMetaItem>>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

krate_span: Span
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

syntax_exts: Vec<NamedSyntaxExtension>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

early_lint_passes: Vec<EarlyLintPassObject>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

late_lint_passes: Vec<LateLintPassObject>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

lint_groups: FxHashMap<&'static str, (Vec<LintId>, Option<&'static str>)>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

llvm_passes: Vec<String>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

attributes: Vec<(String, AttributeType)>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Methods

impl<'a> Registry<'a>[src]

pub fn new(sess: &'a Session, krate_span: Span) -> Registry<'a>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn args<'b>(&'b self) -> &'b [NestedMetaItem][src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Gets 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]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Register a syntax extension of any kind.

This is the most general hook into libsyntax's expansion behavior.

pub fn register_macro(&mut self, name: &str, expander: MacroExpanderFn)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Register a compiler lint pass.

pub fn register_late_lint_pass(&mut self, lint_pass: LateLintPassObject)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Register a compiler lint pass.

pub fn register_lint_group(
    &mut self,
    name: &'static str,
    deprecated_name: Option<&'static str>,
    to: Vec<&'static Lint>
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Register a lint group.

pub fn register_llvm_pass(&mut self, name: &str)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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.

Auto Trait Implementations

impl<'a> !Send for Registry<'a>

impl<'a> !Sync for Registry<'a>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T