@@ -23,7 +23,6 @@ use rustc::driver::driver;
2323use rustc:: driver:: session;
2424use rustc:: metadata:: creader:: Loader ;
2525use syntax:: diagnostic;
26- use syntax:: parse;
2726use syntax:: codemap:: CodeMap ;
2827
2928use core;
@@ -38,29 +37,26 @@ pub fn run(input: &str, libs: HashSet<Path>, mut test_args: ~[~str]) -> int {
3837 let input_path = Path :: new ( input) ;
3938 let input = driver:: FileInput ( input_path. clone ( ) ) ;
4039
41- let sessopts = @ session:: Options {
40+ let sessopts = session:: Options {
4241 maybe_sysroot : Some ( os:: self_exe_path ( ) . unwrap ( ) . dir_path ( ) ) ,
4342 addl_lib_search_paths : RefCell :: new ( libs. clone ( ) ) ,
4443 crate_types : vec ! ( session:: CrateTypeDylib ) ,
45- .. ( * session:: basic_options ( ) ) . clone ( )
44+ ..session:: basic_options ( ) . clone ( )
4645 } ;
4746
4847
49- let cm = @ CodeMap :: new ( ) ;
48+ let codemap = CodeMap :: new ( ) ;
5049 let diagnostic_handler = diagnostic:: default_handler ( ) ;
5150 let span_diagnostic_handler =
52- diagnostic:: mk_span_handler ( diagnostic_handler, cm) ;
53- let parsesess = parse:: new_parse_sess_special_handler ( span_diagnostic_handler,
54- cm) ;
51+ diagnostic:: mk_span_handler ( diagnostic_handler, codemap) ;
5552
5653 let sess = driver:: build_session_ ( sessopts,
5754 Some ( input_path) ,
58- parsesess. cm ,
5955 span_diagnostic_handler) ;
6056
6157 let cfg = driver:: build_configuration ( & sess) ;
6258 let krate = driver:: phase_1_parse_input ( & sess, cfg, & input) ;
63- let ( krate, _) = driver:: phase_2_configure_and_expand ( sess, & mut Loader :: new ( sess) , krate,
59+ let ( krate, _) = driver:: phase_2_configure_and_expand ( & sess, & mut Loader :: new ( & sess) , krate,
6460 & from_str ( "rustdoc-test" ) . unwrap ( ) ) ;
6561
6662 let ctx = @core:: DocContext {
@@ -88,10 +84,9 @@ pub fn run(input: &str, libs: HashSet<Path>, mut test_args: ~[~str]) -> int {
8884fn runtest ( test : & str , cratename : & str , libs : HashSet < Path > , should_fail : bool ,
8985 no_run : bool , loose_feature_gating : bool ) {
9086 let test = maketest ( test, cratename, loose_feature_gating) ;
91- let parsesess = parse:: new_parse_sess ( ) ;
9287 let input = driver:: StrInput ( test) ;
9388
94- let sessopts = @ session:: Options {
89+ let sessopts = session:: Options {
9590 maybe_sysroot : Some ( os:: self_exe_path ( ) . unwrap ( ) . dir_path ( ) ) ,
9691 addl_lib_search_paths : RefCell :: new ( libs) ,
9792 crate_types : vec ! ( session:: CrateTypeExecutable ) ,
@@ -100,7 +95,7 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool,
10095 prefer_dynamic : true ,
10196 .. session:: basic_codegen_options ( )
10297 } ,
103- .. ( * session:: basic_options ( ) ) . clone ( )
98+ ..session:: basic_options ( ) . clone ( )
10499 } ;
105100
106101 // Shuffle around a few input and output handles here. We're going to pass
@@ -126,13 +121,13 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool,
126121 let emitter = diagnostic:: EmitterWriter :: new ( ~w2) ;
127122
128123 // Compile the code
124+ let codemap = CodeMap :: new ( ) ;
129125 let diagnostic_handler = diagnostic:: mk_handler ( ~emitter) ;
130126 let span_diagnostic_handler =
131- diagnostic:: mk_span_handler ( diagnostic_handler, parsesess . cm ) ;
127+ diagnostic:: mk_span_handler ( diagnostic_handler, codemap ) ;
132128
133129 let sess = driver:: build_session_ ( sessopts,
134130 None ,
135- parsesess. cm ,
136131 span_diagnostic_handler) ;
137132
138133 let outdir = TempDir :: new ( "rustdoctest" ) . expect ( "rustdoc needs a tempdir" ) ;
0 commit comments