Skip to content

Commit c6a2399

Browse files
committed
explanatory error on --print target-spec-json without unstable options
Resolves #41683.
1 parent 9bbbd29 commit c6a2399

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)