[][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.


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)>


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(
    sess: &Session,
    attrs: &[Attribute]
) -> OutputFilenames

impl Compiler[src]

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.