Struct rustc_interface::interface::Compiler[−][src]

pub struct Compiler {
    pub(crate) sess: Lrc<Session>,
    codegen_backend: Lrc<Box<dyn CodegenBackend>>,
    pub(crate) input: Input,
    pub(crate) input_path: Option<PathBuf>,
    pub(crate) output_dir: Option<PathBuf>,
    pub(crate) output_file: Option<PathBuf>,
    pub(crate) register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>,
    pub(crate) override_queries: Option<fn(_: &Session, _: &mut Providers, _: &mut Providers)>,
}
Expand description

Represents a compiler session.

Can be used to run rustc_interface queries. Created by passing Config to run_compiler.

Fields

sess: Lrc<Session>codegen_backend: Lrc<Box<dyn CodegenBackend>>input: Inputinput_path: Option<PathBuf>output_dir: Option<PathBuf>output_file: Option<PathBuf>register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>override_queries: Option<fn(_: &Session, _: &mut Providers, _: &mut Providers)>

Implementations

impl Compiler[src]

pub fn session(&self) -> &Lrc<Session>[src]

pub fn codegen_backend(&self) -> &Lrc<Box<dyn CodegenBackend>>[src]

pub fn input(&self) -> &Input[src]

pub fn output_dir(&self) -> &Option<PathBuf>[src]

pub fn output_file(&self) -> &Option<PathBuf>[src]

pub fn register_lints(
    &self
) -> &Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>
[src]

pub fn build_output_filenames(
    &self,
    sess: &Session,
    attrs: &[Attribute]
) -> OutputFilenames
[src]

impl Compiler[src]

pub fn enter<F, T>(&self, f: F) -> T where
    F: for<'tcx> FnOnce(&'tcx Queries<'tcx>) -> T, 
[src]

Auto Trait Implementations

impl !RefUnwindSafe for Compiler

impl !Send for Compiler

impl !Sync for Compiler

impl Unpin for Compiler

impl !UnwindSafe for Compiler

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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

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

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.