@@ -27,7 +27,7 @@ use middle::cstore;
2727use syntax:: ast:: { self , IntTy , UintTy } ;
2828use syntax:: attr;
2929use syntax:: attr:: AttrMetaMethods ;
30- use syntax:: diagnostic :: { ColorConfig , Auto , Always , Never , SpanHandler } ;
30+ use syntax:: errors :: { ColorConfig , Handler } ;
3131use syntax:: parse;
3232use syntax:: parse:: token:: InternedString ;
3333use syntax:: feature_gate:: UnstableFeatures ;
@@ -238,7 +238,7 @@ pub fn basic_options() -> Options {
238238 debugging_opts : basic_debugging_options ( ) ,
239239 prints : Vec :: new ( ) ,
240240 cg : basic_codegen_options ( ) ,
241- color : Auto ,
241+ color : ColorConfig :: Auto ,
242242 show_span : None ,
243243 externs : HashMap :: new ( ) ,
244244 crate_name : None ,
@@ -687,19 +687,19 @@ pub fn build_configuration(sess: &Session) -> ast::CrateConfig {
687687 v
688688}
689689
690- pub fn build_target_config ( opts : & Options , sp : & SpanHandler ) -> Config {
690+ pub fn build_target_config ( opts : & Options , sp : & Handler ) -> Config {
691691 let target = match Target :: search ( & opts. target_triple ) {
692692 Ok ( t) => t,
693693 Err ( e) => {
694- panic ! ( sp. handler ( ) . fatal( & format!( "Error loading target specification: {}" , e) ) ) ;
694+ panic ! ( sp. fatal( & format!( "Error loading target specification: {}" , e) ) ) ;
695695 }
696696 } ;
697697
698698 let ( int_type, uint_type) = match & target. target_pointer_width [ ..] {
699699 "32" => ( ast:: TyI32 , ast:: TyU32 ) ,
700700 "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) ) ) ,
703703 } ;
704704
705705 Config {
@@ -884,16 +884,16 @@ pub fn parse_cfgspecs(cfgspecs: Vec<String> ) -> ast::CrateConfig {
884884
885885pub fn build_session_options ( matches : & getopts:: Matches ) -> Options {
886886 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 ,
890890
891- None => Auto ,
891+ None => ColorConfig :: Auto ,
892892
893893 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) )
897897 }
898898 } ;
899899
@@ -1224,7 +1224,7 @@ mod tests {
12241224 let sessopts = build_session_options ( & matches) ;
12251225 let sess = build_session ( sessopts, None , registry,
12261226 Rc :: new ( DummyCrateStore ) ) ;
1227- assert ! ( !sess. can_print_warnings ) ;
1227+ assert ! ( !sess. diagnostic ( ) . can_emit_warnings ) ;
12281228 }
12291229
12301230 {
@@ -1236,7 +1236,7 @@ mod tests {
12361236 let sessopts = build_session_options ( & matches) ;
12371237 let sess = build_session ( sessopts, None , registry,
12381238 Rc :: new ( DummyCrateStore ) ) ;
1239- assert ! ( sess. can_print_warnings ) ;
1239+ assert ! ( sess. diagnostic ( ) . can_emit_warnings ) ;
12401240 }
12411241
12421242 {
@@ -1247,7 +1247,7 @@ mod tests {
12471247 let sessopts = build_session_options ( & matches) ;
12481248 let sess = build_session ( sessopts, None , registry,
12491249 Rc :: new ( DummyCrateStore ) ) ;
1250- assert ! ( sess. can_print_warnings ) ;
1250+ assert ! ( sess. diagnostic ( ) . can_emit_warnings ) ;
12511251 }
12521252 }
12531253}
0 commit comments