@@ -19,7 +19,7 @@ use syntax::source_map::{FileName, FilePathMapping};
19
19
use syntax:: edition:: { Edition , EDITION_NAME_LIST , DEFAULT_EDITION } ;
20
20
use syntax:: parse:: token;
21
21
use syntax:: parse;
22
- use syntax:: symbol:: Symbol ;
22
+ use syntax:: symbol:: { sym , Symbol } ;
23
23
use syntax:: feature_gate:: UnstableFeatures ;
24
24
use errors:: emitter:: HumanReadableErrorType ;
25
25
@@ -1503,31 +1503,31 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
1503
1503
Some ( Symbol :: intern ( vendor) ) ,
1504
1504
) ) ;
1505
1505
if sess. target . target . options . has_elf_tls {
1506
- ret. insert ( ( Symbol :: intern ( " target_thread_local" ) , None ) ) ;
1506
+ ret. insert ( ( sym :: target_thread_local, None ) ) ;
1507
1507
}
1508
1508
for & i in & [ 8 , 16 , 32 , 64 , 128 ] {
1509
1509
if i >= min_atomic_width && i <= max_atomic_width {
1510
1510
let s = i. to_string ( ) ;
1511
1511
ret. insert ( (
1512
- Symbol :: intern ( " target_has_atomic" ) ,
1512
+ sym :: target_has_atomic,
1513
1513
Some ( Symbol :: intern ( & s) ) ,
1514
1514
) ) ;
1515
1515
if & s == wordsz {
1516
1516
ret. insert ( (
1517
- Symbol :: intern ( " target_has_atomic" ) ,
1517
+ sym :: target_has_atomic,
1518
1518
Some ( Symbol :: intern ( "ptr" ) ) ,
1519
1519
) ) ;
1520
1520
}
1521
1521
}
1522
1522
}
1523
1523
if atomic_cas {
1524
- ret. insert ( ( Symbol :: intern ( " target_has_atomic" ) , Some ( Symbol :: intern ( "cas" ) ) ) ) ;
1524
+ ret. insert ( ( sym :: target_has_atomic, Some ( Symbol :: intern ( "cas" ) ) ) ) ;
1525
1525
}
1526
1526
if sess. opts . debug_assertions {
1527
1527
ret. insert ( ( Symbol :: intern ( "debug_assertions" ) , None ) ) ;
1528
1528
}
1529
1529
if sess. opts . crate_types . contains ( & CrateType :: ProcMacro ) {
1530
- ret. insert ( ( Symbol :: intern ( " proc_macro" ) , None ) ) ;
1530
+ ret. insert ( ( sym :: proc_macro, None ) ) ;
1531
1531
}
1532
1532
ret
1533
1533
}
@@ -1547,7 +1547,7 @@ pub fn build_configuration(sess: &Session, mut user_cfg: ast::CrateConfig) -> as
1547
1547
let default_cfg = default_configuration ( sess) ;
1548
1548
// If the user wants a test runner, then add the test cfg
1549
1549
if sess. opts . test {
1550
- user_cfg. insert ( ( Symbol :: intern ( " test" ) , None ) ) ;
1550
+ user_cfg. insert ( ( sym :: test, None ) ) ;
1551
1551
}
1552
1552
user_cfg. extend ( default_cfg. iter ( ) . cloned ( ) ) ;
1553
1553
user_cfg
@@ -2702,7 +2702,7 @@ mod tests {
2702
2702
use std:: path:: PathBuf ;
2703
2703
use super :: { Externs , OutputType , OutputTypes } ;
2704
2704
use rustc_target:: spec:: { MergeFunctions , PanicStrategy , RelroLevel } ;
2705
- use syntax:: symbol:: Symbol ;
2705
+ use syntax:: symbol:: sym ;
2706
2706
use syntax:: edition:: { Edition , DEFAULT_EDITION } ;
2707
2707
use syntax;
2708
2708
use super :: Options ;
@@ -2744,15 +2744,14 @@ mod tests {
2744
2744
let ( sessopts, cfg) = build_session_options_and_crate_config ( matches) ;
2745
2745
let sess = build_session ( sessopts, None , registry) ;
2746
2746
let cfg = build_configuration ( & sess, to_crate_config ( cfg) ) ;
2747
- assert ! ( cfg. contains( & ( Symbol :: intern ( " test" ) , None ) ) ) ;
2747
+ assert ! ( cfg. contains( & ( sym :: test, None ) ) ) ;
2748
2748
} ) ;
2749
2749
}
2750
2750
2751
2751
// When the user supplies --test and --cfg test, don't implicitly add
2752
2752
// another --cfg test
2753
2753
#[ test]
2754
2754
fn test_switch_implies_cfg_test_unless_cfg_test ( ) {
2755
- use syntax:: symbol:: sym;
2756
2755
syntax:: with_default_globals ( || {
2757
2756
let matches = & match optgroups ( ) . parse ( & [ "--test" . to_string ( ) ,
2758
2757
"--cfg=test" . to_string ( ) ] ) {
0 commit comments