Skip to content

Commit 381d51d

Browse files
committed
Auto merge of #43260 - zackmdavis:print_target_spec_json_unstable_options_error, r=arielb1
explanatory error on `--print target-spec-json` without unstable options ![unstable_target_spec](https://user-images.githubusercontent.com/1076988/28243342-9731a45c-697a-11e7-9852-bad7ca1802b7.png) Resolves #41683.
2 parents 1beaea2 + c6a2399 commit 381d51d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/librustc/session/config.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1615,8 +1615,15 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
16151615
"target-features" => PrintRequest::TargetFeatures,
16161616
"relocation-models" => PrintRequest::RelocationModels,
16171617
"code-models" => PrintRequest::CodeModels,
1618-
"target-spec-json" if nightly_options::is_unstable_enabled(matches)
1619-
=> PrintRequest::TargetSpec,
1618+
"target-spec-json" => {
1619+
if nightly_options::is_unstable_enabled(matches) {
1620+
PrintRequest::TargetSpec
1621+
} else {
1622+
early_error(error_format,
1623+
&format!("the `-Z unstable-options` flag must also be passed to \
1624+
enable the target-spec-json print option"));
1625+
}
1626+
},
16201627
req => {
16211628
early_error(error_format, &format!("unknown print request `{}`", req))
16221629
}

0 commit comments

Comments
 (0)