@@ -23,7 +23,6 @@ use rustc::driver::driver;
23
23
use rustc:: driver:: session;
24
24
use rustc:: metadata:: creader:: Loader ;
25
25
use syntax:: diagnostic;
26
- use syntax:: parse;
27
26
use syntax:: codemap:: CodeMap ;
28
27
29
28
use core;
@@ -38,29 +37,26 @@ pub fn run(input: &str, libs: HashSet<Path>, mut test_args: ~[~str]) -> int {
38
37
let input_path = Path :: new ( input) ;
39
38
let input = driver:: FileInput ( input_path. clone ( ) ) ;
40
39
41
- let sessopts = @ session:: Options {
40
+ let sessopts = session:: Options {
42
41
maybe_sysroot : Some ( os:: self_exe_path ( ) . unwrap ( ) . dir_path ( ) ) ,
43
42
addl_lib_search_paths : RefCell :: new ( libs. clone ( ) ) ,
44
43
crate_types : vec ! ( session:: CrateTypeDylib ) ,
45
- .. ( * session:: basic_options ( ) ) . clone ( )
44
+ ..session:: basic_options ( ) . clone ( )
46
45
} ;
47
46
48
47
49
- let cm = @ CodeMap :: new ( ) ;
48
+ let codemap = CodeMap :: new ( ) ;
50
49
let diagnostic_handler = diagnostic:: default_handler ( ) ;
51
50
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) ;
55
52
56
53
let sess = driver:: build_session_ ( sessopts,
57
54
Some ( input_path) ,
58
- parsesess. cm ,
59
55
span_diagnostic_handler) ;
60
56
61
57
let cfg = driver:: build_configuration ( & sess) ;
62
58
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,
64
60
& from_str ( "rustdoc-test" ) . unwrap ( ) ) ;
65
61
66
62
let ctx = @core:: DocContext {
@@ -88,10 +84,9 @@ pub fn run(input: &str, libs: HashSet<Path>, mut test_args: ~[~str]) -> int {
88
84
fn runtest ( test : & str , cratename : & str , libs : HashSet < Path > , should_fail : bool ,
89
85
no_run : bool , loose_feature_gating : bool ) {
90
86
let test = maketest ( test, cratename, loose_feature_gating) ;
91
- let parsesess = parse:: new_parse_sess ( ) ;
92
87
let input = driver:: StrInput ( test) ;
93
88
94
- let sessopts = @ session:: Options {
89
+ let sessopts = session:: Options {
95
90
maybe_sysroot : Some ( os:: self_exe_path ( ) . unwrap ( ) . dir_path ( ) ) ,
96
91
addl_lib_search_paths : RefCell :: new ( libs) ,
97
92
crate_types : vec ! ( session:: CrateTypeExecutable ) ,
@@ -100,7 +95,7 @@ fn runtest(test: &str, cratename: &str, libs: HashSet<Path>, should_fail: bool,
100
95
prefer_dynamic : true ,
101
96
.. session:: basic_codegen_options ( )
102
97
} ,
103
- .. ( * session:: basic_options ( ) ) . clone ( )
98
+ ..session:: basic_options ( ) . clone ( )
104
99
} ;
105
100
106
101
// 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,
126
121
let emitter = diagnostic:: EmitterWriter :: new ( ~w2) ;
127
122
128
123
// Compile the code
124
+ let codemap = CodeMap :: new ( ) ;
129
125
let diagnostic_handler = diagnostic:: mk_handler ( ~emitter) ;
130
126
let span_diagnostic_handler =
131
- diagnostic:: mk_span_handler ( diagnostic_handler, parsesess . cm ) ;
127
+ diagnostic:: mk_span_handler ( diagnostic_handler, codemap ) ;
132
128
133
129
let sess = driver:: build_session_ ( sessopts,
134
130
None ,
135
- parsesess. cm ,
136
131
span_diagnostic_handler) ;
137
132
138
133
let outdir = TempDir :: new ( "rustdoctest" ) . expect ( "rustdoc needs a tempdir" ) ;
0 commit comments