pub enum TargetSpecVersion {
Older,
Rustc_1_85_0,
Rustc_1_76_0,
Rustc_1_93_0,
Rustc_1_94_0,
}Expand description
Enum for different versions of target specs, to allow changing the target spec for different rust versions. The version listed in the enum is always the minimum version to require said target spec, with the newest version always at the top.
Variants§
Older
Rustc_1_85_0
Introduced in 489c3ee6fd63da3ca7cf2b15e1ee709d8e078aab in the old v2 target spec way, later ported to here.
remove os: unknown, add crt-static-respected: true
Rustc_1_76_0
rustc 1.76 has been tested to correctly parse modern target spec jsons. Some later version requires them. Some earlier version fails with them (notably our 0.9.0 release).
Rustc_1_93_0
rustc 1.93 requires that the value of “target-pointer-width” is no longer a string but u16
Rustc_1_94_0
rustc 1.94.0 destabilised json target specs, requiring -Ztarget-spec-json
see https://github.com/Rust-GPU/rust-gpu/pull/545
see https://github.com/rust-lang/rust/pull/150151
Implementations§
Source§impl TargetSpecVersion
impl TargetSpecVersion
Sourcepub fn target_arg(
rustc_version: Version,
target: &SpirvTarget,
target_spec_folder: &Path,
) -> Result<TargetSpec, Error>
pub fn target_arg( rustc_version: Version, target: &SpirvTarget, target_spec_folder: &Path, ) -> Result<TargetSpec, Error>
Format the --target arg. On newer rustc versions, will create a compatible target spec json file and return
the absolute path to it, on older rustc versions may return the target name.
Sourcepub fn from_rustc_version(rustc_version: Version) -> TargetSpecVersion
pub fn from_rustc_version(rustc_version: Version) -> TargetSpecVersion
Returns the version of the target spec required for a certain rustc version. May return None if the version
is old enough to not need target specs.
Sourcepub fn format_spec(&self, target: &SpirvTarget) -> String
pub fn format_spec(&self, target: &SpirvTarget) -> String
format the target spec json
Trait Implementations§
Source§impl Clone for TargetSpecVersion
impl Clone for TargetSpecVersion
Source§fn clone(&self) -> TargetSpecVersion
fn clone(&self) -> TargetSpecVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetSpecVersion
impl Debug for TargetSpecVersion
Source§impl Ord for TargetSpecVersion
impl Ord for TargetSpecVersion
Source§fn cmp(&self, other: &TargetSpecVersion) -> Ordering
fn cmp(&self, other: &TargetSpecVersion) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for TargetSpecVersion
impl PartialEq for TargetSpecVersion
Source§impl PartialOrd for TargetSpecVersion
impl PartialOrd for TargetSpecVersion
impl Copy for TargetSpecVersion
impl Eq for TargetSpecVersion
impl StructuralPartialEq for TargetSpecVersion
Auto Trait Implementations§
impl Freeze for TargetSpecVersion
impl RefUnwindSafe for TargetSpecVersion
impl Send for TargetSpecVersion
impl Sync for TargetSpecVersion
impl Unpin for TargetSpecVersion
impl UnsafeUnpin for TargetSpecVersion
impl UnwindSafe for TargetSpecVersion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.