Refactor argument UTF-8 checking into rustc_driver::args::raw_args()
This commit is contained in:
parent
63091b105d
commit
fb87e606cc
3 changed files with 28 additions and 23 deletions
|
@ -1515,15 +1515,7 @@ pub fn main() -> ! {
|
|||
let mut callbacks = TimePassesCallbacks::default();
|
||||
let using_internal_features = install_ice_hook(DEFAULT_BUG_REPORT_URL, |_| ());
|
||||
let exit_code = catch_with_exit_code(|| {
|
||||
let args = env::args_os()
|
||||
.enumerate()
|
||||
.map(|(i, arg)| {
|
||||
arg.into_string().unwrap_or_else(|arg| {
|
||||
early_dcx.early_fatal(format!("argument {i} is not valid Unicode: {arg:?}"))
|
||||
})
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
RunCompiler::new(&args, &mut callbacks)
|
||||
RunCompiler::new(&args::raw_args(&early_dcx)?, &mut callbacks)
|
||||
.set_using_internal_features(using_internal_features)
|
||||
.run()
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue