Struct rustc_ap_rustc_target::spec::Target[][src]

pub struct Target {
    pub llvm_target: String,
    pub pointer_width: u32,
    pub arch: String,
    pub data_layout: String,
    pub options: TargetOptions,
}
Expand description

Everything rustc knows about how to compile for a specific target.

Every field here must be specified, and has no default value.

Fields

llvm_target: String

Target triple to pass to LLVM.

pointer_width: u32

Number of bits in a pointer. Influences the target_pointer_width cfg variable.

arch: String

Architecture to use for ABI considerations. Valid options include: “x86”, “x86_64”, “arm”, “aarch64”, “mips”, “powerpc”, “powerpc64”, and others.

data_layout: String

Data layout to pass to LLVM.

options: TargetOptions

Optional settings with defaults.

Implementations

Given a function ABI, turn it into the correct ABI for this target.

Minimum integer size in bits that this target can perform atomic operations on.

Maximum integer size in bits that this target can perform atomic operations on.

Loads a target descriptor from a JSON object.

Search for a JSON file specifying the given target triple.

If none is found in $RUST_TARGET_PATH, look for a file called target.json inside the sysroot under the target-triple’s rustlib directory. Note that it could also just be a bare filename already, so also check for that. If one of the hardcoded targets we know about, just return it directly.

The error string could come from any of the APIs called, including filesystem access and JSON decoding.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

TargetOptions being a separate type is basically an implementation detail of Target that is used for providing defaults. Perhaps there’s a way to merge TargetOptions into Target so this Deref implementation is no longer necessary.

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Converts the value of self to an instance of JSON

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.