about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-20 06:38:41 +0000
committerbors <bors@rust-lang.org>2017-07-20 06:38:41 +0000
commit381d51dc495e3f604a35781d8de910ad7bfaf74b (patch)
treedf7b64b8400d8f6e2b740e31330dff0f14165889 /src
parent1beaea26ff447b267ac11102d3c5d27a38820894 (diff)
parentc6a23996cad66dcaed52cf2c5b482641df7273bb (diff)
downloadrust-381d51dc495e3f604a35781d8de910ad7bfaf74b.tar.gz
rust-381d51dc495e3f604a35781d8de910ad7bfaf74b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/librustc/session/config.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 5661c412302..2a790d0f61e 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -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))
             }