diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-11-15 16:13:15 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2017-11-15 18:13:33 +0100 |
| commit | 9338b4903aa3696dcba77d0719675a74049e47a9 (patch) | |
| tree | f531dd3d645afdfdf90b7af7c57e94fcad2ea271 | |
| parent | 58557fafae060c500394d5df13cd0cf68170903e (diff) | |
| download | rust-9338b4903aa3696dcba77d0719675a74049e47a9.tar.gz rust-9338b4903aa3696dcba77d0719675a74049e47a9.zip | |
Set short-message feature unstable
| -rw-r--r-- | src/librustc/session/config.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/short-error-format.rs | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index c4fc30429e0..e939fd50501 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -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) => { diff --git a/src/test/ui/short-error-format.rs b/src/test/ui/short-error-format.rs index 3e6802c51c3..ecce824ca17 100644 --- a/src/test/ui/short-error-format.rs +++ b/src/test/ui/short-error-format.rs @@ -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) {} |
