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
This commit is contained in:
Alex Crichton 2015-02-10 08:42:57 -08:00
commit c33acf658a
2 changed files with 4 additions and 1 deletions

View File

@ -1076,7 +1076,9 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
part));
}
};
crate_types.push(new_part)
if !crate_types.contains(&new_part) {
crate_types.push(new_part)
}
}
}

View File

@ -2,3 +2,4 @@ include ../tools.mk
all:
$(RUSTC) --crate-type=rlib foo.rs
$(RUSTC) --crate-type=rlib,rlib foo.rs