File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
rustc_codegen_ssa/src/back Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ fn produce_final_output_artifacts(
592592 . unwrap ( )
593593 . to_owned ( ) ;
594594
595- if crate_output. outputs . contains_key ( & output_type) {
595+ if crate_output. outputs . contains_explicit_name ( & output_type) {
596596 // 2) Multiple codegen units, with `--emit foo=some_name`. We have
597597 // no good solution for this case, so warn the user.
598598 sess. dcx ( ) . emit_warn ( errors:: IgnoringEmitPath { extension } ) ;
Original file line number Diff line number Diff line change @@ -557,6 +557,11 @@ impl OutputTypes {
557557 self . 0 . contains_key ( key)
558558 }
559559
560+ /// Returns `true` if user specified a name and not just produced type
561+ pub fn contains_explicit_name ( & self , key : & OutputType ) -> bool {
562+ self . 0 . get ( key) . map_or ( false , |f| f. is_some ( ) )
563+ }
564+
560565 pub fn iter ( & self ) -> BTreeMapIter < ' _ , OutputType , Option < OutFileName > > {
561566 self . 0 . iter ( )
562567 }
You can’t perform that action at this time.
0 commit comments