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§
Trait Implementations§
impl Copy for SaveTemps
impl Eq for SaveTemps
Source§impl FromStr for SaveTemps
impl FromStr for SaveTemps
Source§fn from_str(s: &str) -> Result<SaveTemps, String>
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.