@@ -27,7 +27,7 @@ use middle::cstore;
27
27
use syntax:: ast:: { self , IntTy , UintTy } ;
28
28
use syntax:: attr;
29
29
use syntax:: attr:: AttrMetaMethods ;
30
- use syntax:: diagnostic :: { ColorConfig , Auto , Always , Never , SpanHandler } ;
30
+ use syntax:: errors :: { ColorConfig , Handler } ;
31
31
use syntax:: parse;
32
32
use syntax:: parse:: token:: InternedString ;
33
33
use syntax:: feature_gate:: UnstableFeatures ;
@@ -238,7 +238,7 @@ pub fn basic_options() -> Options {
238
238
debugging_opts : basic_debugging_options ( ) ,
239
239
prints : Vec :: new ( ) ,
240
240
cg : basic_codegen_options ( ) ,
241
- color : Auto ,
241
+ color : ColorConfig :: Auto ,
242
242
show_span : None ,
243
243
externs : HashMap :: new ( ) ,
244
244
crate_name : None ,
@@ -687,19 +687,19 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
687
687
v
688
688
}
689
689
690
- pub fn build_target_config ( opts : & Options , sp : & SpanHandler ) -> Config {
690
+ pub fn build_target_config ( opts : & Options , sp : & Handler ) -> Config {
691
691
let target = match Target :: search ( & opts. target_triple ) {
692
692
Ok ( t) => t,
693
693
Err ( e) => {
694
- panic ! ( sp. handler ( ) . fatal( & format!( "Error loading target specification: {}" , e) ) ) ;
694
+ panic ! ( sp. fatal( & format!( "Error loading target specification: {}" , e) ) ) ;
695
695
}
696
696
} ;
697
697
698
698
let ( int_type, uint_type) = match & target. target_pointer_width [ ..] {
699
699
"32" => ( ast:: TyI32 , ast:: TyU32 ) ,
700
700
"64" => ( ast:: TyI64 , ast:: TyU64 ) ,
701
- w => panic ! ( sp. handler ( ) . fatal( & format!( "target specification was invalid: \
702
- unrecognized target-pointer-width {}", w) ) ) ,
701
+ w => panic ! ( sp. fatal( & format!( "target specification was invalid: \
702
+ unrecognized target-pointer-width {}", w) ) ) ,
703
703
} ;
704
704
705
705
Config {
@@ -884,16 +884,16 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String> ) -> ast::CrateConfig {
884
884
885
885
pub fn build_session_options ( matches : & getopts:: Matches ) -> Options {
886
886
let color = match matches. opt_str ( "color" ) . as_ref ( ) . map ( |s| & s[ ..] ) {
887
- Some ( "auto" ) => Auto ,
888
- Some ( "always" ) => Always ,
889
- Some ( "never" ) => Never ,
887
+ Some ( "auto" ) => ColorConfig :: Auto ,
888
+ Some ( "always" ) => ColorConfig :: Always ,
889
+ Some ( "never" ) => ColorConfig :: Never ,
890
890
891
- None => Auto ,
891
+ None => ColorConfig :: Auto ,
892
892
893
893
Some ( arg) => {
894
- early_error ( Auto , & format ! ( "argument for --color must be auto, always \
895
- or never (instead was `{}`)",
896
- arg) )
894
+ early_error ( ColorConfig :: Auto , & format ! ( "argument for --color must be auto, always \
895
+ or never (instead was `{}`)",
896
+ arg) )
897
897
}
898
898
} ;
899
899
@@ -1224,7 +1224,7 @@ mod tests {
1224
1224
let sessopts = build_session_options ( & matches) ;
1225
1225
let sess = build_session ( sessopts, None , registry,
1226
1226
Rc :: new ( DummyCrateStore ) ) ;
1227
- assert ! ( !sess. can_print_warnings ) ;
1227
+ assert ! ( !sess. diagnostic ( ) . can_emit_warnings ) ;
1228
1228
}
1229
1229
1230
1230
{
@@ -1236,7 +1236,7 @@ mod tests {
1236
1236
let sessopts = build_session_options ( & matches) ;
1237
1237
let sess = build_session ( sessopts, None , registry,
1238
1238
Rc :: new ( DummyCrateStore ) ) ;
1239
- assert ! ( sess. can_print_warnings ) ;
1239
+ assert ! ( sess. diagnostic ( ) . can_emit_warnings ) ;
1240
1240
}
1241
1241
1242
1242
{
@@ -1247,7 +1247,7 @@ mod tests {
1247
1247
let sessopts = build_session_options ( & matches) ;
1248
1248
let sess = build_session ( sessopts, None , registry,
1249
1249
Rc :: new ( DummyCrateStore ) ) ;
1250
- assert ! ( sess. can_print_warnings ) ;
1250
+ assert ! ( sess. diagnostic ( ) . can_emit_warnings ) ;
1251
1251
}
1252
1252
}
1253
1253
}
0 commit comments