@@ -80,7 +80,8 @@ pub struct CrateAnalysis {
80
80
pub type Externs = HashMap < String , Vec < String > > ;
81
81
82
82
/// Parses, resolves, and typechecks the given crate
83
- fn get_ast_and_resolve ( cpath : & Path , libs : HashSet < Path > , cfgs : Vec < String > , externs : Externs )
83
+ fn get_ast_and_resolve ( cpath : & Path , libs : HashSet < Path > , cfgs : Vec < String > ,
84
+ externs : Externs , triple : Option < String > )
84
85
-> ( DocContext , CrateAnalysis ) {
85
86
use syntax:: codemap:: dummy_spanned;
86
87
use rustc:: driver:: driver:: { FileInput ,
@@ -99,6 +100,7 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<String>, ext
99
100
crate_types : vec ! ( driver:: config:: CrateTypeRlib ) ,
100
101
lint_opts : vec ! ( ( warning_lint, lint:: Allow ) ) ,
101
102
externs : externs,
103
+ target_triple : triple. unwrap_or ( driver:: driver:: host_triple ( ) . to_string ( ) ) ,
102
104
..rustc:: driver:: config:: basic_options ( ) . clone ( )
103
105
} ;
104
106
@@ -151,9 +153,10 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<String>, ext
151
153
} )
152
154
}
153
155
154
- pub fn run_core ( libs : HashSet < Path > , cfgs : Vec < String > , externs : Externs , path : & Path )
156
+ pub fn run_core ( libs : HashSet < Path > , cfgs : Vec < String > , externs : Externs ,
157
+ path : & Path , triple : Option < String > )
155
158
-> ( clean:: Crate , CrateAnalysis ) {
156
- let ( ctxt, analysis) = get_ast_and_resolve ( path, libs, cfgs, externs) ;
159
+ let ( ctxt, analysis) = get_ast_and_resolve ( path, libs, cfgs, externs, triple ) ;
157
160
let ctxt = box ( GC ) ctxt;
158
161
super :: ctxtkey. replace ( Some ( ctxt) ) ;
159
162
0 commit comments