@@ -62,11 +62,11 @@ pub enum PpMode {
62
62
*/
63
63
pub fn anon_src ( ) -> @str { @"<anon>" }
64
64
65
- pub fn source_name(input: &input ) -> @str {
65
+ pub fn source_name(input: &Input ) -> @str {
66
66
match *input {
67
67
// FIXME (#9639): This needs to handle non-utf8 paths
68
- file_input (ref ifile) => ifile.as_str().unwrap().to_managed(),
69
- str_input (_) => anon_src()
68
+ FileInput (ref ifile) => ifile.as_str().unwrap().to_managed(),
69
+ StrInput (_) => anon_src()
70
70
}
71
71
}
72
72
@@ -133,22 +133,22 @@ fn parse_cfgspecs(cfgspecs: ~[~str], demitter: @diagnostic::Emitter)
133
133
} ) . collect :: < ast:: CrateConfig > ( )
134
134
}
135
135
136
- pub enum input {
136
+ pub enum Input {
137
137
/// Load source from file
138
- file_input ( Path ) ,
138
+ FileInput ( Path ) ,
139
139
/// The string is the source
140
140
// FIXME (#2319): Don't really want to box the source string
141
- str_input ( @str )
141
+ StrInput ( @str )
142
142
}
143
143
144
- pub fn phase_1_parse_input ( sess : Session , cfg : ast:: CrateConfig , input : & input )
144
+ pub fn phase_1_parse_input ( sess : Session , cfg : ast:: CrateConfig , input : & Input )
145
145
-> ast:: Crate {
146
146
time ( sess. time_passes ( ) , "parsing" , ( ) , |_| {
147
147
match * input {
148
- file_input ( ref file) => {
148
+ FileInput ( ref file) => {
149
149
parse:: parse_crate_from_file ( & ( * file) , cfg. clone ( ) , sess. parse_sess )
150
150
}
151
- str_input ( src) => {
151
+ StrInput ( src) => {
152
152
parse:: parse_crate_from_source_str (
153
153
anon_src ( ) , src, cfg. clone ( ) , sess. parse_sess )
154
154
}
@@ -444,7 +444,7 @@ pub fn stop_after_phase_5(sess: Session) -> bool {
444
444
return false ;
445
445
}
446
446
447
- fn write_out_deps ( sess : Session , input : & input , outputs : & OutputFilenames , crate : & ast:: Crate )
447
+ fn write_out_deps ( sess : Session , input : & Input , outputs : & OutputFilenames , crate : & ast:: Crate )
448
448
{
449
449
let lm = link:: build_link_meta ( sess, crate . attrs, & outputs. obj_filename ,
450
450
& mut :: util:: sha2:: Sha256 :: new ( ) ) ;
@@ -460,12 +460,12 @@ fn write_out_deps(sess: Session, input: &input, outputs: &OutputFilenames, crate
460
460
( true , Some ( ref filename) ) => filename. clone ( ) ,
461
461
// Use default filename: crate source filename with extension replaced by ".d"
462
462
( true , None ) => match * input {
463
- file_input ( ref input_path) => {
463
+ FileInput ( ref input_path) => {
464
464
let filestem = input_path. filestem ( ) . expect ( "input file must have stem" ) ;
465
465
let filename = out_filenames[ 0 ] . dir_path ( ) . join ( filestem) . with_extension ( "d" ) ;
466
466
filename
467
467
} ,
468
- str_input ( ..) => {
468
+ StrInput ( ..) => {
469
469
sess. warn ( "can not write --dep-info without a filename when compiling stdin." ) ;
470
470
return ;
471
471
} ,
@@ -495,7 +495,7 @@ fn write_out_deps(sess: Session, input: &input, outputs: &OutputFilenames, crate
495
495
}
496
496
}
497
497
498
- pub fn compile_input ( sess : Session , cfg : ast:: CrateConfig , input : & input ,
498
+ pub fn compile_input ( sess : Session , cfg : ast:: CrateConfig , input : & Input ,
499
499
outdir : & Option < Path > , output : & Option < Path > ) {
500
500
// We need nested scopes here, because the intermediate results can keep
501
501
// large chunks of memory alive and we want to free them as soon as
@@ -587,7 +587,7 @@ impl pprust::PpAnn for TypedAnnotation {
587
587
588
588
pub fn pretty_print_input ( sess : Session ,
589
589
cfg : ast:: CrateConfig ,
590
- input : & input ,
590
+ input : & Input ,
591
591
ppm : PpMode ) {
592
592
let crate = phase_1_parse_input ( sess, cfg. clone ( ) , input) ;
593
593
@@ -664,9 +664,9 @@ static architecture_abis : &'static [(&'static str, abi::Architecture)] = &'stat
664
664
665
665
( "mips" , abi:: Mips ) ] ;
666
666
667
- pub fn build_target_config ( sopts : @session:: options ,
667
+ pub fn build_target_config ( sopts : @session:: Options ,
668
668
demitter : @diagnostic:: Emitter )
669
- -> @session:: config {
669
+ -> @session:: Config {
670
670
let os = match get_os ( sopts. target_triple ) {
671
671
Some ( os) => os,
672
672
None => early_error ( demitter, "unknown operating system" )
@@ -689,7 +689,7 @@ pub fn build_target_config(sopts: @session::options,
689
689
abi:: Arm => arm:: get_target_strs ( target_triple, os) ,
690
690
abi:: Mips => mips:: get_target_strs ( target_triple, os)
691
691
} ;
692
- let target_cfg = @session:: config {
692
+ let target_cfg = @session:: Config {
693
693
os : os,
694
694
arch : arch,
695
695
target_strs : target_strs,
@@ -714,7 +714,7 @@ pub fn host_triple() -> ~str {
714
714
pub fn build_session_options ( binary : ~str ,
715
715
matches : & getopts:: Matches ,
716
716
demitter : @diagnostic:: Emitter )
717
- -> @session:: options {
717
+ -> @session:: Options {
718
718
let mut outputs = ~[ ] ;
719
719
if matches. opt_present ( "rlib" ) {
720
720
outputs. push ( session:: OutputRlib )
@@ -862,7 +862,7 @@ pub fn build_session_options(binary: ~str,
862
862
matches. opt_present ( "crate-name" ) ,
863
863
matches. opt_present ( "crate-file-name" ) ) ;
864
864
865
- let sopts = @session:: options {
865
+ let sopts = @session:: Options {
866
866
outputs : outputs,
867
867
gc : gc,
868
868
optimize : opt_level,
@@ -895,7 +895,7 @@ pub fn build_session_options(binary: ~str,
895
895
return sopts;
896
896
}
897
897
898
- pub fn build_session ( sopts : @session:: options , demitter : @diagnostic:: Emitter )
898
+ pub fn build_session ( sopts : @session:: Options , demitter : @diagnostic:: Emitter )
899
899
-> Session {
900
900
let codemap = @codemap:: CodeMap :: new ( ) ;
901
901
let diagnostic_handler =
@@ -905,7 +905,7 @@ pub fn build_session(sopts: @session::options, demitter: @diagnostic::Emitter)
905
905
build_session_ ( sopts, codemap, demitter, span_diagnostic_handler)
906
906
}
907
907
908
- pub fn build_session_ ( sopts : @session:: options ,
908
+ pub fn build_session_ ( sopts : @session:: Options ,
909
909
cm : @codemap:: CodeMap ,
910
910
demitter : @diagnostic:: Emitter ,
911
911
span_diagnostic_handler : @diagnostic:: SpanHandler )
@@ -914,7 +914,7 @@ pub fn build_session_(sopts: @session::options,
914
914
let p_s = parse:: new_parse_sess_special_handler ( span_diagnostic_handler,
915
915
cm) ;
916
916
let cstore = @CStore :: new ( token:: get_ident_interner ( ) ) ;
917
- let filesearch = filesearch:: mk_filesearch (
917
+ let filesearch = @ filesearch:: FileSearch :: new (
918
918
& sopts. maybe_sysroot ,
919
919
sopts. target_triple ,
920
920
sopts. addl_lib_search_paths ) ;
@@ -1046,7 +1046,7 @@ pub struct OutputFilenames {
1046
1046
obj_filename : Path
1047
1047
}
1048
1048
1049
- pub fn build_output_filenames ( input : & input ,
1049
+ pub fn build_output_filenames ( input : & Input ,
1050
1050
odir : & Option < Path > ,
1051
1051
ofile : & Option < Path > ,
1052
1052
attrs : & [ ast:: Attribute ] ,
@@ -1074,15 +1074,15 @@ pub fn build_output_filenames(input: &input,
1074
1074
let dirpath = match * odir {
1075
1075
Some ( ref d) => ( * d) . clone ( ) ,
1076
1076
None => match * input {
1077
- str_input ( _) => os:: getcwd ( ) ,
1078
- file_input ( ref ifile) => ( * ifile) . dir_path ( )
1077
+ StrInput ( _) => os:: getcwd ( ) ,
1078
+ FileInput ( ref ifile) => ( * ifile) . dir_path ( )
1079
1079
}
1080
1080
} ;
1081
1081
1082
1082
let mut stem = match * input {
1083
1083
// FIXME (#9639): This needs to handle non-utf8 paths
1084
- file_input ( ref ifile) => ( * ifile) . filestem_str ( ) . unwrap ( ) . to_managed ( ) ,
1085
- str_input ( _) => @"rust_out"
1084
+ FileInput ( ref ifile) => ( * ifile) . filestem_str ( ) . unwrap ( ) . to_managed ( ) ,
1085
+ StrInput ( _) => @"rust_out"
1086
1086
} ;
1087
1087
1088
1088
// If a crateid is present, we use it as the link name
0 commit comments