Struct rustc_interface::interface::Compiler
source · pub struct Compiler {
pub(crate) sess: Lrc<Session>,
codegen_backend: Lrc<dyn CodegenBackend>,
pub(crate) register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>,
pub(crate) override_queries: Option<fn(_: &Session, _: &mut Providers)>,
}
Expand description
Represents a compiler session. Note that every Compiler
contains a
Session
, but Compiler
also contains some things that cannot be in
Session
, due to Session
being in a crate that has many fewer
dependencies than this crate.
Can be used to run rustc_interface
queries.
Created by passing Config
to run_compiler
.
Fields§
§sess: Lrc<Session>
§codegen_backend: Lrc<dyn CodegenBackend>
§register_lints: Option<Box<dyn Fn(&Session, &mut LintStore) + Send + Sync>>
§override_queries: Option<fn(_: &Session, _: &mut Providers)>
Implementations§
source§impl Compiler
impl Compiler
pub fn session(&self) -> &Lrc<Session>
pub fn codegen_backend(&self) -> &Lrc<dyn CodegenBackend>
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn 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: 48 bytes