Mode in bootstrap - Rust
Description: The various “modes” of invoking Cargo.

Skip to main content

## Mode

# Enum Mode

Source

    pub enum Mode {
        Std,
        Rustc,
        Codegen,
        ToolBootstrap,
        ToolTarget,
        ToolStd,
        ToolRustcPrivate,
    }

Expand description

The various “modes” of invoking Cargo.

These entries currently correspond to the various output directories of the build system, with each mod generating output in a different directory.

## Variants§

§

### Std

Build the standard library, placing output in the “stageN-std” directory.

§

### Rustc

Build librustc, and compiler libraries, placing output in the “stageN-rustc” directory.

§

### Codegen

Build a codegen backend for rustc, placing the output in the “stageN-codegen” directory.

§

### ToolBootstrap

Build a tool, placing output in the “bootstrap-tools” directory. This is for miscellaneous sets of tools that extend bootstrap.

These tools are intended to be only executed on the host system that invokes bootstrap, and they thus cannot be cross-compiled.

They are always built using the stage0 compiler, and they can be compiled with stable Rust.

These tools also essentially do not participate in staging.

§

### ToolTarget

Build a cross-compilable helper tool. These tools do not depend on unstable features or compiler internals, but they might be cross-compilable (so we cannot build them using the stage0 compiler, unlike `ToolBootstrap`).

Some of these tools are also shipped in our `dist` archives. While we could compile them using the stage0 compiler when not cross-compiling, we instead use the in-tree compiler (and std) to build them, so that we can ship e.g. std security fixes and avoid depending fully on stage0 for the artifacts that we ship.

This mode is used e.g. for linkers and linker tools invoked by rustc on its host target.

§

### ToolStd

Build a tool which uses the locally built std, placing output in the “stageN-tools” directory. Its usage is quite rare; historically it was needed by compiletest, but now it is mainly used by `test-float-parse`.

§

### ToolRustcPrivate

Build a tool which uses the `rustc_private` mechanism, and thus the locally built rustc rlib artifacts, placing the output in the “stageN-tools” directory. This is used for everything that links to rustc as a library, such as rustdoc, clippy, rustfmt, miri, etc.

## Implementations§

Source§

### impl Mode

Source

#### pub fn must_support_dlopen(&self) -> bool

## Trait Implementations§

Source§

### impl Clone for Mode

Source§

#### fn clone(&self) -> Mode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from `source`. Read more
Source§

### impl Copy for Mode

Source§

### impl Debug for Mode

Source§

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

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

### impl Eq for Mode

Source§

### impl Hash for Mode

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 Mode

Source§

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

Tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 (const: unstable) · 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 StructuralPartialEq for Mode

## Auto Trait Implementations§

§

### impl Freeze for Mode

§

### impl RefUnwindSafe for Mode

§

### impl Send for Mode

§

### impl Sync for Mode

§

### impl Unpin for Mode

§

### impl UnsafeUnpin for Mode

§

### impl UnwindSafe for Mode

## 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: 1 byte

Size for each variant:

- `Std`: 0 bytes
- `Rustc`: 0 bytes
- `Codegen`: 0 bytes
- `ToolBootstrap`: 0 bytes
- `ToolTarget`: 0 bytes
- `ToolStd`: 0 bytes
- `ToolRustcPrivate`: 0 bytes