This commit is contained in:
Felix Obenhuber 2022-08-16 14:47:41 +02:00 коммит произвёл Sylvestre Ledru
Родитель b9be3f7b5b
Коммит d609de74a9
6 изменённых файлов: 22 добавлений и 21 удалений

Просмотреть файл

@ -11,7 +11,7 @@ pub type ArgParseResult<T> = StdResult<T, ArgParseError>;
pub type ArgToStringResult = StdResult<String, ArgToStringError>;
pub type PathTransformerFn<'a> = &'a mut dyn FnMut(&Path) -> Option<String>;
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum ArgParseError {
UnexpectedEndOfArgs,
InvalidUnicode(OsString),
@ -35,7 +35,7 @@ impl Error for ArgParseError {
}
}
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum ArgToStringError {
FailedPathTransform(PathBuf),
InvalidUnicode(OsString),
@ -69,7 +69,7 @@ pub type Delimiter = Option<u8>;
/// on the different kinds of argument). `Flag`s may contain a simple
/// variant which influences how to do caching, whereas `WithValue`s could
/// be a struct variant with parsed data from the value.
#[derive(PartialEq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug)]
pub enum Argument<T> {
/// Unknown non-flag argument ; e.g. "foo"
Raw(OsString),
@ -83,7 +83,7 @@ pub enum Argument<T> {
}
/// How a value is passed to an argument with a value.
#[derive(PartialEq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug)]
pub enum ArgDisposition {
/// As "-arg value"
Separated,
@ -299,7 +299,7 @@ macro_rules! ArgData {
// PartialEq necessary for tests
{ pub $( $tok:tt )+ } => {
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ArgData {
$($tok)+
}
@ -387,7 +387,7 @@ pub fn split_os_string_arg(val: OsString, split: &str) -> ArgParseResult<(String
}
/// The description of how an argument may be parsed
#[derive(PartialEq, Clone, Debug)]
#[derive(PartialEq, Eq, Clone, Debug)]
pub enum ArgInfo<T> {
/// An simple flag argument, of the form "-foo"
Flag(&'static str, T),

Просмотреть файл

@ -60,7 +60,7 @@ where
compiler: I,
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Language {
C,
Cxx,
@ -70,7 +70,7 @@ pub enum Language {
}
/// Artifact produced by a C/C++ compiler.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ArtifactDesciptor {
/// Path to the artifact.
pub path: PathBuf,
@ -80,7 +80,7 @@ pub struct ArtifactDesciptor {
/// The results of parsing a compiler commandline.
#[allow(dead_code)]
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct ParsedArguments {
/// The input source file.
pub input: PathBuf,
@ -166,7 +166,7 @@ struct CCompilation<I: CCompilerImpl> {
}
/// Supported C compilers.
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum CCompilerKind {
/// GCC
Gcc,

Просмотреть файл

@ -79,7 +79,7 @@ impl CompileCommand {
}
/// Supported compilers.
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum CompilerKind {
/// A C compiler.
C(CCompilerKind),
@ -691,7 +691,7 @@ pub struct HashResult {
}
/// Possible results of parsing compiler arguments.
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum CompilerArguments<T> {
/// Commandline can be handled.
Ok(T),
@ -720,7 +720,7 @@ macro_rules! try_or_cannot_cache {
}
/// Specifics about distributed compilation.
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum DistType {
/// Distribution was not enabled.
NoDist,
@ -731,7 +731,7 @@ pub enum DistType {
}
/// Specifics about cache misses.
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum MissType {
/// The compilation was not found in the cache, nothing more.
Normal,
@ -772,7 +772,7 @@ pub enum CompileResult {
}
/// The state of `--color` options passed to a compiler.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ColorMode {
Off,
On,
@ -818,14 +818,14 @@ impl PartialEq<CompileResult> for CompileResult {
}
/// Can this result be stored in cache?
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Cacheable {
Yes,
No,
}
/// Control of caching behavior.
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum CacheControl {
/// Default caching behavior.
Default,

Просмотреть файл

@ -36,7 +36,7 @@ use crate::errors::*;
/// A struct on which to implement `CCompilerImpl`.
///
/// Needs a little bit of state just to persist `includes_prefix`.
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Msvc {
/// The prefix used in the output of `-showIncludes`.
pub includes_prefix: String,

Просмотреть файл

@ -180,7 +180,7 @@ pub struct RustCompilation {
}
// The selection of crate types for this compilation
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CrateTypes {
rlib: bool,
staticlib: bool,
@ -3148,7 +3148,8 @@ proc_macro false
o => panic!("Got unexpected parse result: {:?}", o),
};
// Just use empty files for sources.
for src in ["foo.rs"].iter() {
{
let src = &"foo.rs";
let s = format!("Failed to create {}", src);
f.touch(src).expect(&s);
}

Просмотреть файл

@ -89,7 +89,7 @@ const OUTPUT: &str = "test.o";
// Copy the source files into the tempdir so we can compile with relative paths, since the commandline winds up in the hash key.
fn copy_to_tempdir(inputs: &[&str], tempdir: &Path) {
for f in inputs {
let original_source_file = Path::new(file!()).parent().unwrap().join(&*f);
let original_source_file = Path::new(file!()).parent().unwrap().join(f);
let source_file = tempdir.join(f);
trace!("fs::copy({:?}, {:?})", original_source_file, source_file);
fs::copy(&original_source_file, &source_file).unwrap();