@@ -268,16 +268,16 @@ pub type LinkArgs = BTreeMap<LinkerFlavor, Vec<String>>;
268
268
pub type TargetResult = Result < Target , String > ;
269
269
270
270
macro_rules! supported_targets {
271
- ( $( ( $triple: expr , $module: ident) , ) + ) => (
272
- $( mod $module; ) *
271
+ ( $( ( $( $ triple: literal , ) + $module: ident ) , ) + ) => {
272
+ $( mod $module; ) +
273
273
274
274
/// List of supported targets
275
- const TARGETS : & [ & str ] = & [ $( $triple) ,* ] ;
275
+ const TARGETS : & [ & str ] = & [ $( $( $ triple) ,+ ) ,+ ] ;
276
276
277
277
fn load_specific( target: & str ) -> Result <Target , LoadTargetError > {
278
278
match target {
279
279
$(
280
- $triple => {
280
+ $( $ triple) |+ => {
281
281
let mut t = $module:: target( )
282
282
. map_err( LoadTargetError :: Other ) ?;
283
283
t. options. is_builtin = true ;
@@ -307,7 +307,7 @@ macro_rules! supported_targets {
307
307
mod test_json_encode_decode {
308
308
use serialize:: json:: ToJson ;
309
309
use super :: Target ;
310
- $( use super :: $module; ) *
310
+ $( use super :: $module; ) +
311
311
312
312
$(
313
313
#[ test]
@@ -322,9 +322,9 @@ macro_rules! supported_targets {
322
322
assert_eq!( original, parsed) ;
323
323
} ) ;
324
324
}
325
- ) *
325
+ ) +
326
326
}
327
- )
327
+ } ;
328
328
}
329
329
330
330
supported_targets ! {
@@ -426,7 +426,9 @@ supported_targets! {
426
426
( "armv7r-none-eabi" , armv7r_none_eabi) ,
427
427
( "armv7r-none-eabihf" , armv7r_none_eabihf) ,
428
428
429
- ( "x86_64-sun-solaris" , x86_64_sun_solaris) ,
429
+ // `x86_64-pc-solaris` is an alias for `x86_64_sun_solaris` for backwards compatibility reasons.
430
+ // (See <https://github.com/rust-lang/rust/issues/40531>.)
431
+ ( "x86_64-sun-solaris" , "x86_64-pc-solaris" , x86_64_sun_solaris) ,
430
432
( "sparcv9-sun-solaris" , sparcv9_sun_solaris) ,
431
433
432
434
( "x86_64-pc-windows-gnu" , x86_64_pc_windows_gnu) ,
0 commit comments