Skip to main content

SaveTemps

Enum SaveTemps 

Source
pub enum SaveTemps {
    No,
    Object,
    Cwd,
}
Expand description

Whether -save-temps was given and where it puts the files it keeps.

Design: spec/04-driver-and-cli.md section 4.10.

The flag is how a build gets at the preprocessed source of the file that failed without running the compiler a second time under different flags, which is the one way to be sure the text being read is the text that was compiled. A bug report against a compiler is usually a preprocessed file and nothing else, and this is where that file comes from.

Variants§

§

No

Not asked for, and nothing is kept.

§

Object

Beside the file the compilation produced, which is -save-temps=obj.

This is what the bare -save-temps does as well. GCC’s manual says the bare spelling is -save-temps=cwd, and gcc 16 does not do that: -save-temps -c a.c -o out/a.o leaves out/a.i and out/a.s rather than a.i and a.s. The measurement is what is followed here, because a build that reads the manual and a build that reads the compiler both end up looking for the files where the compiler put them.

§

Cwd

In the working directory, which is -save-temps=cwd.

Implementations§

Source§

impl SaveTemps

Source

pub const fn wanted(self) -> bool

Whether anything is kept at all.

Trait Implementations§

Source§

impl Clone for SaveTemps

Source§

fn clone(&self) -> SaveTemps

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 SaveTemps

Source§

impl Debug for SaveTemps

Source§

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

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

impl Default for SaveTemps

Source§

fn default() -> SaveTemps

Returns the “default value” for a type. Read more
Source§

impl Eq for SaveTemps

Source§

impl FromStr for SaveTemps

Source§

fn from_str(s: &str) -> Result<SaveTemps, String>

Reads what came after the =, which is the only part that varies.

§Errors

Returns the offending word. GCC treats an unknown one as fatal rather than ignoring it, which is right: a misspelled keyword here means the files a person went looking for are not written and nothing said so.

Source§

type Err = String

The associated error which can be returned from parsing.
Source§

impl PartialEq for SaveTemps

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SaveTemps

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.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.