@@ -168,23 +168,6 @@ fn main() {
168
168
let args = Args :: parse ( ) ;
169
169
170
170
// Build a TranspilerConfig from the command line
171
- let cc_json_path = Path :: new ( & args. compile_commands ) ;
172
- let cc_json_path = cc_json_path. canonicalize ( ) . unwrap_or_else ( |_| {
173
- panic ! (
174
- "Could not find compile_commands.json file at path: {}" ,
175
- cc_json_path. display( )
176
- )
177
- } ) ;
178
-
179
- let extra_args = args
180
- . extra_clang_args
181
- . iter ( )
182
- . map ( AsRef :: as_ref)
183
- . collect :: < Vec < _ > > ( ) ;
184
- let extra_args = extra_args. as_slice ( ) ;
185
-
186
- let enabled_warnings = args. warn . into_iter ( ) . collect ( ) ;
187
-
188
171
let mut tcfg = TranspilerConfig {
189
172
dump_untyped_context : args. dump_untyped_clang_ast ,
190
173
dump_typed_context : args. dump_typed_clang_ast ,
@@ -231,7 +214,7 @@ fn main() {
231
214
panic_on_translator_failure : args. invalid_code == InvalidCodes :: Panic ,
232
215
replace_unsupported_decls : ReplaceMode :: Extern ,
233
216
emit_no_std : args. emit_no_std ,
234
- enabled_warnings,
217
+ enabled_warnings : args . warn . into_iter ( ) . collect ( ) ,
235
218
log_level : args. log_level ,
236
219
} ;
237
220
// binaries imply emit-build-files
@@ -243,5 +226,19 @@ fn main() {
243
226
tcfg. emit_modules = true
244
227
} ;
245
228
246
- c2rust_transpile:: transpile ( tcfg, & cc_json_path, extra_args) ;
229
+ let cc_json_path = Path :: new ( & args. compile_commands ) ;
230
+ let cc_json_path = cc_json_path. canonicalize ( ) . unwrap_or_else ( |_| {
231
+ panic ! (
232
+ "Could not find compile_commands.json file at path: {}" ,
233
+ cc_json_path. display( )
234
+ )
235
+ } ) ;
236
+
237
+ let extra_args = args
238
+ . extra_clang_args
239
+ . iter ( )
240
+ . map ( AsRef :: as_ref)
241
+ . collect :: < Vec < _ > > ( ) ;
242
+
243
+ c2rust_transpile:: transpile ( tcfg, & cc_json_path, & extra_args) ;
247
244
}
0 commit comments