Struct rustc_interface::interface::Compiler
source · 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) temps_dir: 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 ExternProviders)>,
}
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: Input
input_path: Option<PathBuf>
output_dir: Option<PathBuf>
output_file: Option<PathBuf>
temps_dir: Option<PathBuf>
register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>
override_queries: Option<fn(_: &Session, _: &mut Providers, _: &mut ExternProviders)>
Implementations
sourceimpl Compiler
impl Compiler
pub fn session(&self) -> &Lrc<Session>
pub fn codegen_backend(&self) -> &Lrc<Box<dyn CodegenBackend>>
pub fn input(&self) -> &Input
pub fn output_dir(&self) -> &Option<PathBuf>
pub fn output_file(&self) -> &Option<PathBuf>
pub fn temps_dir(&self) -> &Option<PathBuf>
pub fn register_lints(
&self
) -> &Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>
pub fn build_output_filenames(
&self,
sess: &Session,
attrs: &[Attribute]
) -> OutputFilenames
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 216 bytes