Skip to content

Deduplicate --crate-type arguments #22115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2015
Merged

Conversation

nagisa
Copy link
Member

@nagisa nagisa commented Feb 9, 2015

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

@@ -1061,7 +1061,9 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>) -> Result<Vec<CrateTy
part));
}
};
crate_types.push(new_part)
if crate_types.iter().all(|e| { *e != new_part }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can also be expressed as if !crate_types.contains(&new_part)

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.
@nagisa nagisa force-pushed the dedupe-cratetypes branch from 9eebd1a to a6e8496 Compare February 9, 2015 17:51
@alexcrichton
Copy link
Member

@bors: r+ a6e8496 rollup

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 10, 2015
…chton

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
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 10, 2015
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
@bors bors merged commit a6e8496 into rust-lang:master Feb 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants