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

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) crate_name: Option<String>,
    pub(crate) register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>,
    pub(crate) override_queries: Option<fn(_: &Session, _: &mut Providers, _: &mut Providers)>,
}

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>crate_name: Option<String>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 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]

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

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

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

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

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.

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.