]> git.lizzy.rs Git - rust.git/commitdiff
Set short-message feature unstable
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 15 Nov 2017 15:13:15 +0000 (16:13 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 15 Nov 2017 17:13:33 +0000 (18:13 +0100)
src/librustc/session/config.rs
src/test/ui/short-error-format.rs

index c4fc30429e0aabe965516f3fcd8c68d186c57a5f..e939fd5050164128f0863650de2b0dee5f7041d7 100644 (file)
@@ -1435,8 +1435,15 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
             Some("human") => ErrorOutputType::HumanReadable(color),
             Some("json")  => ErrorOutputType::Json(false),
             Some("pretty-json") => ErrorOutputType::Json(true),
-            Some("short") => ErrorOutputType::Short(color),
-
+            Some("short") => {
+                if nightly_options::is_unstable_enabled(matches) {
+                    ErrorOutputType::Short(color)
+                } else {
+                    early_error(ErrorOutputType::default(),
+                                &format!("the `-Z unstable-options` flag must also be passed to \
+                                          enable the short error message option"));
+                }
+            }
             None => ErrorOutputType::HumanReadable(color),
 
             Some(arg) => {
index 3e6802c51c3a695bff14dcacdd25178d38cf42f5..ecce824ca178b34ce742ca7172d4d75adc9f9efb 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: --error-format=short
+// compile-flags: --error-format=short -Zunstable-options
 
 fn foo(_: u32) {}