Skip to content

Commit

Permalink
explanatory error on --print target-spec-json without unstable options
Browse files Browse the repository at this point in the history
Resolves rust-lang#41683.
  • Loading branch information
zackmdavis committed Jul 19, 2017
1 parent 9bbbd29 commit c6a2399
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,8 +1615,15 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
"target-features" => PrintRequest::TargetFeatures,
"relocation-models" => PrintRequest::RelocationModels,
"code-models" => PrintRequest::CodeModels,
"target-spec-json" if nightly_options::is_unstable_enabled(matches)
=> PrintRequest::TargetSpec,
"target-spec-json" => {
if nightly_options::is_unstable_enabled(matches) {
PrintRequest::TargetSpec
} else {
early_error(error_format,
&format!("the `-Z unstable-options` flag must also be passed to \
enable the target-spec-json print option"));
}
},
req => {
early_error(error_format, &format!("unknown print request `{}`", req))
}
Expand Down

0 comments on commit c6a2399

Please sign in to comment.