Skip to content

Commit

Permalink
Deduplicate --crate-type arguments
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nagisa committed Feb 9, 2015
1 parent 0ba9e1f commit a6e8496
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc/session/config.rs
Expand Up @@ -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.contains(&new_part) {
crate_types.push(new_part)
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/run-make/duplicate-output-flavors/Makefile
Expand Up @@ -2,3 +2,4 @@ include ../tools.mk

all:
$(RUSTC) --crate-type=rlib foo.rs
$(RUSTC) --crate-type=rlib,rlib foo.rs

0 comments on commit a6e8496

Please sign in to comment.