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

impl Target[src]

pub fn adjust_abi(&self, abi: Abi) -> Abi[src]

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

pub fn min_atomic_width(&self) -> u64[src]

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

pub fn max_atomic_width(&self) -> u64[src]

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

pub fn is_abi_supported(&self, abi: Abi) -> bool[src]

pub fn from_json(obj: Json) -> Result<Target, String>[src]

Loads a target descriptor from a JSON object.

pub fn search(
    target_triple: &TargetTriple,
    sysroot: &PathBuf
) -> Result<Target, String>
[src]

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

impl Clone for Target[src]

fn clone(&self) -> Target[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Target[src]

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

Formats the value using the given formatter. Read more

impl Deref for Target[src]

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.

type Target = TargetOptions

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl DerefMut for Target[src]

fn deref_mut(&mut self) -> &mut Self::Target[src]

Mutably dereferences the value.

impl HasTargetSpec for Target[src]

fn target_spec(&self) -> &Target[src]

impl PartialEq<Target> for Target[src]

fn eq(&self, other: &Target) -> bool[src]

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

fn ne(&self, other: &Target) -> bool[src]

This method tests for !=.

impl ToJson for Target[src]

fn to_json(&self) -> Json[src]

Converts the value of self to an instance of JSON

impl StructuralPartialEq for Target[src]

Auto Trait Implementations

impl RefUnwindSafe for Target

impl Send for Target

impl Sync for Target

impl Unpin for Target

impl UnwindSafe for Target

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> MaybeResult<T> for T[src]

type Error = !

pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]

pub fn to_result(Self) -> Result<T, <T as MaybeResult<T>>::Error>[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]