diff --git a/src/compiler/compiler.rs b/src/compiler/compiler.rs index 1a0bc6377..7f5e0a0bd 100644 --- a/src/compiler/compiler.rs +++ b/src/compiler/compiler.rs @@ -1233,14 +1233,14 @@ compiler_version=__VERSION__ } "nvcc" | "nvcc-msvc" | "nvcc-nvhpc" => { let host_compiler = match kind { - "nvcc-nvhpc" => NvccHostCompiler::NVHPC, - "nvcc-msvc" => NvccHostCompiler::MSVC, - "nvcc" => NvccHostCompiler::GCC, - &_ => NvccHostCompiler::GCC, + "nvcc-nvhpc" => NvccHostCompiler::Nvhpc, + "nvcc-msvc" => NvccHostCompiler::Msvc, + "nvcc" => NvccHostCompiler::Gcc, + &_ => NvccHostCompiler::Gcc, }; return CCompiler::new( Nvcc { - host_compiler: host_compiler, + host_compiler, version: version.clone(), }, executable, diff --git a/src/compiler/nvcc.rs b/src/compiler/nvcc.rs index 87438ff5e..f3e9fdda3 100644 --- a/src/compiler/nvcc.rs +++ b/src/compiler/nvcc.rs @@ -39,9 +39,9 @@ use crate::errors::*; /// A unit struct on which to implement `CCompilerImpl`. #[derive(Clone, Debug)] pub enum NvccHostCompiler { - GCC, - MSVC, - NVHPC, + Gcc, + Msvc, + Nvhpc, } #[derive(Clone, Debug)] @@ -161,9 +161,9 @@ impl CCompilerImpl for Nvcc { // msvc requires the `-EP` flag to output no line numbers to console // other host compilers are presumed to match `gcc` behavior let no_line_num_flag = match self.host_compiler { - NvccHostCompiler::NVHPC => "", - NvccHostCompiler::MSVC => "-Xcompiler=-EP", - NvccHostCompiler::GCC => "-Xcompiler=-P", + NvccHostCompiler::Nvhpc => "", + NvccHostCompiler::Msvc => "-Xcompiler=-EP", + NvccHostCompiler::Gcc => "-Xcompiler=-P", }; cmd.arg("-E") .arg(no_line_num_flag) @@ -277,7 +277,7 @@ mod test { fn parse_arguments_gcc(arguments: Vec) -> CompilerArguments { let arguments = arguments.iter().map(OsString::from).collect::>(); Nvcc { - host_compiler: NvccHostCompiler::GCC, + host_compiler: NvccHostCompiler::Gcc, version: None, } .parse_arguments(&arguments, ".".as_ref()) @@ -285,7 +285,7 @@ mod test { fn parse_arguments_nvc(arguments: Vec) -> CompilerArguments { let arguments = arguments.iter().map(OsString::from).collect::>(); Nvcc { - host_compiler: NvccHostCompiler::NVHPC, + host_compiler: NvccHostCompiler::Nvhpc, version: None, } .parse_arguments(&arguments, ".".as_ref())