@@ -9,8 +9,8 @@ use rustc_data_structures::fx::FxIndexMap;
99use rustc_errors:: DiagCtxtHandle ;
1010use rustc_session:: config:: {
1111 self , CodegenOptions , CrateType , ErrorOutputType , Externs , Input , JsonUnusedExterns ,
12- OptionsTargetModifiers , Sysroot , UnstableOptions , get_cmd_lint_options, nightly_options ,
13- parse_crate_types_from_list, parse_externs, parse_target_triple,
12+ OptionsTargetModifiers , OutFileName , Sysroot , UnstableOptions , get_cmd_lint_options,
13+ nightly_options , parse_crate_types_from_list, parse_externs, parse_target_triple,
1414} ;
1515use rustc_session:: lint:: Level ;
1616use rustc_session:: search_paths:: SearchPath ;
@@ -320,7 +320,7 @@ pub(crate) enum EmitType {
320320 Unversioned ,
321321 Toolchain ,
322322 InvocationSpecific ,
323- DepInfo ( Option < PathBuf > ) ,
323+ DepInfo ( Option < OutFileName > ) ,
324324}
325325
326326impl FromStr for EmitType {
@@ -332,13 +332,11 @@ impl FromStr for EmitType {
332332 "toolchain-shared-resources" => Ok ( Self :: Toolchain ) ,
333333 "invocation-specific" => Ok ( Self :: InvocationSpecific ) ,
334334 "dep-info" => Ok ( Self :: DepInfo ( None ) ) ,
335- option => {
336- if let Some ( file) = option. strip_prefix ( "dep-info=" ) {
337- Ok ( Self :: DepInfo ( Some ( Path :: new ( file) . into ( ) ) ) )
338- } else {
339- Err ( ( ) )
340- }
341- }
335+ option => match option. strip_prefix ( "dep-info=" ) {
336+ Some ( "-" ) => Ok ( Self :: DepInfo ( Some ( OutFileName :: Stdout ) ) ) ,
337+ Some ( f) => Ok ( Self :: DepInfo ( Some ( OutFileName :: Real ( f. into ( ) ) ) ) ) ,
338+ None => Err ( ( ) ) ,
339+ } ,
342340 }
343341 }
344342}
@@ -348,10 +346,10 @@ impl RenderOptions {
348346 self . emit . is_empty ( ) || self . emit . contains ( & EmitType :: InvocationSpecific )
349347 }
350348
351- pub ( crate ) fn dep_info ( & self ) -> Option < Option < & Path > > {
349+ pub ( crate ) fn dep_info ( & self ) -> Option < Option < & OutFileName > > {
352350 for emit in & self . emit {
353351 if let EmitType :: DepInfo ( file) = emit {
354- return Some ( file. as_deref ( ) ) ;
352+ return Some ( file. as_ref ( ) ) ;
355353 }
356354 }
357355 None
0 commit comments