File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -177,13 +177,16 @@ pub fn main() {
177177 init_logging ( & early_dcx) ;
178178 rustc_driver:: init_logger ( & early_dcx, rustc_log:: LoggerConfig :: from_env ( "RUSTDOC_LOG" ) ) ;
179179
180- let exit_code = rustc_driver:: catch_with_exit_code ( || match get_args ( & early_dcx) {
181- Some ( args) => main_args ( & mut early_dcx, & args, using_internal_features) ,
182- _ =>
183- {
184- #[ allow( deprecated) ]
185- Err ( ErrorGuaranteed :: unchecked_claim_error_was_emitted ( ) )
186- }
180+ let exit_code = rustc_driver:: catch_with_exit_code ( || {
181+ let args = env:: args_os ( )
182+ . enumerate ( )
183+ . map ( |( i, arg) | {
184+ arg. into_string ( ) . unwrap_or_else ( |arg| {
185+ early_dcx. early_fatal ( format ! ( "argument {i} is not valid Unicode: {arg:?}" ) )
186+ } )
187+ } )
188+ . collect :: < Vec < _ > > ( ) ;
189+ main_args ( & mut early_dcx, & args, using_internal_features)
187190 } ) ;
188191 process:: exit ( exit_code) ;
189192}
@@ -219,19 +222,6 @@ fn init_logging(early_dcx: &EarlyDiagCtxt) {
219222 tracing:: subscriber:: set_global_default ( subscriber) . unwrap ( ) ;
220223}
221224
222- fn get_args ( early_dcx : & EarlyDiagCtxt ) -> Option < Vec < String > > {
223- env:: args_os ( )
224- . enumerate ( )
225- . map ( |( i, arg) | {
226- arg. into_string ( )
227- . map_err ( |arg| {
228- early_dcx. early_warn ( format ! ( "Argument {i} is not valid Unicode: {arg:?}" ) ) ;
229- } )
230- . ok ( )
231- } )
232- . collect ( )
233- }
234-
235225fn opts ( ) -> Vec < RustcOptGroup > {
236226 let stable: fn ( _, fn ( & mut getopts:: Options ) -> & mut _ ) -> _ = RustcOptGroup :: stable;
237227 let unstable: fn ( _, fn ( & mut getopts:: Options ) -> & mut _ ) -> _ = RustcOptGroup :: unstable;
You can’t perform that action at this time.
0 commit comments