Skip to content

Commit 9e97e08

Browse files
committed
Rollup merge of rust-lang#22115 - nagisa:dedupe-cratetypes, r=alexcrichton
Crate types from multiple sources appear to be deduplicated properly, but not deduplicated if they come from the command line arguments. At worst, this used to cause compiler failures when `--crate-type=lib,rlib` (the same as `--crate-type=rlib,rlib`, at least at the time of this commit) is provided and generate the output multiple times otherwise. r? @alexcrichton
2 parents 98cb33f + a6e8496 commit 9e97e08

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/librustc/session/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,9 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
10761076
part));
10771077
}
10781078
};
1079-
crate_types.push(new_part)
1079+
if !crate_types.contains(&new_part) {
1080+
crate_types.push(new_part)
1081+
}
10801082
}
10811083
}
10821084

src/test/run-make/duplicate-output-flavors/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ include ../tools.mk
22

33
all:
44
$(RUSTC) --crate-type=rlib foo.rs
5+
$(RUSTC) --crate-type=rlib,rlib foo.rs

0 commit comments

Comments
 (0)