File tree 3 files changed +29
-1
lines changed
rustc_codegen_ssa/src/back
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -592,7 +592,7 @@ fn produce_final_output_artifacts(
592
592
. unwrap ( )
593
593
. to_owned ( ) ;
594
594
595
- if crate_output. outputs . contains_key ( & output_type) {
595
+ if crate_output. outputs . contains_explicit_name ( & output_type) {
596
596
// 2) Multiple codegen units, with `--emit foo=some_name`. We have
597
597
// no good solution for this case, so warn the user.
598
598
sess. dcx ( ) . emit_warn ( errors:: IgnoringEmitPath { extension } ) ;
Original file line number Diff line number Diff line change @@ -557,6 +557,11 @@ impl OutputTypes {
557
557
self . 0 . contains_key ( key)
558
558
}
559
559
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
+
560
565
pub fn iter ( & self ) -> BTreeMapIter < ' _ , OutputType , Option < OutFileName > > {
561
566
self . 0 . iter ( )
562
567
}
Original file line number Diff line number Diff line change
1
+ //@ build-pass
2
+ //@ compile-flags: -C codegen-units=2 --emit asm
3
+
4
+ fn one ( ) -> usize {
5
+ 1
6
+ }
7
+
8
+ pub mod a {
9
+ pub fn two ( ) -> usize {
10
+ :: one ( ) + :: one ( )
11
+ }
12
+ }
13
+
14
+ pub mod b {
15
+ pub fn three ( ) -> usize {
16
+ :: one ( ) + :: a:: two ( )
17
+ }
18
+ }
19
+
20
+ fn main ( ) {
21
+ a:: two ( ) ;
22
+ b:: three ( ) ;
23
+ }
You can’t perform that action at this time.
0 commit comments