Skip to content

Commit 9873acc

Browse files
committed
Remove --crate-type=metadata deprecation warning
Fixes #38640
1 parent 5d2512e commit 9873acc

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/librustc/session/config.rs

+4-14
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
13541354
};
13551355

13561356
let unparsed_crate_types = matches.opt_strs("crate-type");
1357-
let (crate_types, emit_metadata) = parse_crate_types_from_list(unparsed_crate_types)
1357+
let crate_types = parse_crate_types_from_list(unparsed_crate_types)
13581358
.unwrap_or_else(|e| early_error(error_format, &e[..]));
13591359

13601360
let mut lint_opts = vec![];
@@ -1402,9 +1402,7 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
14021402
}
14031403
}
14041404
};
1405-
if emit_metadata {
1406-
output_types.insert(OutputType::Metadata, None);
1407-
} else if output_types.is_empty() {
1405+
if output_types.is_empty() {
14081406
output_types.insert(OutputType::Exe, None);
14091407
}
14101408

@@ -1629,9 +1627,8 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
16291627
}
16301628

16311629
pub fn parse_crate_types_from_list(list_list: Vec<String>)
1632-
-> Result<(Vec<CrateType>, bool), String> {
1630+
-> Result<Vec<CrateType>, String> {
16331631
let mut crate_types: Vec<CrateType> = Vec::new();
1634-
let mut emit_metadata = false;
16351632
for unparsed_crate_type in &list_list {
16361633
for part in unparsed_crate_type.split(',') {
16371634
let new_part = match part {
@@ -1642,13 +1639,6 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>)
16421639
"cdylib" => CrateTypeCdylib,
16431640
"bin" => CrateTypeExecutable,
16441641
"proc-macro" => CrateTypeProcMacro,
1645-
// FIXME(#38640) remove this when Cargo is fixed.
1646-
"metadata" => {
1647-
early_warn(ErrorOutputType::default(), "--crate-type=metadata is deprecated, \
1648-
prefer --emit=metadata");
1649-
emit_metadata = true;
1650-
CrateTypeRlib
1651-
}
16521642
_ => {
16531643
return Err(format!("unknown crate type: `{}`",
16541644
part));
@@ -1660,7 +1650,7 @@ pub fn parse_crate_types_from_list(list_list: Vec<String>)
16601650
}
16611651
}
16621652

1663-
return Ok((crate_types, emit_metadata));
1653+
Ok(crate_types)
16641654
}
16651655

16661656
pub mod nightly_options {

0 commit comments

Comments
 (0)