Skip to content

Commit c33acf6

Browse files
committed
rollup merge of #22115: nagisa/dedupe-cratetypes
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 b6e5f1b + a6e8496 commit c33acf6

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)