diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs index 844edbb946a51..42ba49ba2b8db 100644 --- a/src/librustc_target/spec/mod.rs +++ b/src/librustc_target/spec/mod.rs @@ -268,16 +268,16 @@ pub type LinkArgs = BTreeMap>; pub type TargetResult = Result; macro_rules! supported_targets { - ( $(($triple:expr, $module:ident),)+ ) => ( - $(mod $module;)* + ( $(($( $triple:literal, )+ $module:ident ),)+ ) => { + $(mod $module;)+ /// List of supported targets - const TARGETS: &[&str] = &[$($triple),*]; + const TARGETS: &[&str] = &[$($($triple),+),+]; fn load_specific(target: &str) -> Result { match target { $( - $triple => { + $($triple)|+ => { let mut t = $module::target() .map_err(LoadTargetError::Other)?; t.options.is_builtin = true; @@ -307,7 +307,7 @@ macro_rules! supported_targets { mod test_json_encode_decode { use serialize::json::ToJson; use super::Target; - $(use super::$module;)* + $(use super::$module;)+ $( #[test] @@ -322,9 +322,9 @@ macro_rules! supported_targets { assert_eq!(original, parsed); }); } - )* + )+ } - ) + }; } supported_targets! { @@ -426,7 +426,9 @@ supported_targets! { ("armv7r-none-eabi", armv7r_none_eabi), ("armv7r-none-eabihf", armv7r_none_eabihf), - ("x86_64-sun-solaris", x86_64_sun_solaris), + // `x86_64-pc-solaris` is an alias for `x86_64_sun_solaris` for backwards compatibility reasons. + // (See .) + ("x86_64-sun-solaris", "x86_64-pc-solaris", x86_64_sun_solaris), ("sparcv9-sun-solaris", sparcv9_sun_solaris), ("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu), diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 5efd51b65c14a..b6e087c3844fa 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -118,6 +118,7 @@ static TARGETS: &[&str] = &[ "x86_64-pc-windows-msvc", "x86_64-rumprun-netbsd", "x86_64-sun-solaris", + "x86_64-pc-solaris", "x86_64-unknown-cloudabi", "x86_64-unknown-freebsd", "x86_64-unknown-linux-gnu",