Struct RustcPrivateCompilers

Source
pub struct RustcPrivateCompilers {
    build_compiler: Compiler,
    target_compiler: Compiler,
}
Expand description

Represents which compilers are involved in the compilation of a tool that depends on compiler internals (rustc_private). Their compilation looks like this:

  • build_compiler (stage N-1) builds target_compiler (stage N) to produce .rlibs
    • These .rlibs are copied into the sysroot of build_compiler
  • build_compiler (stage N-1) builds <tool> (stage N)
    • <tool> links to .rlibs from target_compiler

Eventually, this could also be used for .rmetas and check builds, but so far we only deal with normal builds here.

Fields§

§build_compiler: Compiler

Compiler that builds the tool and that builds target_compiler.

§target_compiler: Compiler

Compiler to which .rlib artifacts the tool links to. The host target of this compiler corresponds to the target of the tool.

Implementations§

Source§

impl RustcPrivateCompilers

Source

pub fn new(builder: &Builder<'_>, stage: u32, target: TargetSelection) -> Self

Create compilers for a rustc_private tool with the given stage and for the given target.

Source

pub fn from_build_and_target_compiler( build_compiler: Compiler, target_compiler: Compiler, ) -> Self

Source

pub fn from_build_compiler( builder: &Builder<'_>, build_compiler: Compiler, target: TargetSelection, ) -> Self

Create rustc tool compilers from the build compiler.

Source

pub fn from_target_compiler( builder: &Builder<'_>, target_compiler: Compiler, ) -> Self

Create rustc tool compilers from the target compiler.

Source

fn build_compiler_from_stage(builder: &Builder<'_>, stage: u32) -> Compiler

Source

pub fn build_compiler(&self) -> Compiler

Source

pub fn target_compiler(&self) -> Compiler

Source

pub fn target(&self) -> TargetSelection

Target of the tool being compiled

Trait Implementations§

Source§

impl Clone for RustcPrivateCompilers

Source§

fn clone(&self) -> RustcPrivateCompilers

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RustcPrivateCompilers

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for RustcPrivateCompilers

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RustcPrivateCompilers

Source§

fn eq(&self, other: &RustcPrivateCompilers) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for RustcPrivateCompilers

Source§

impl Eq for RustcPrivateCompilers

Source§

impl StructuralPartialEq for RustcPrivateCompilers

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.

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: 80 bytes