Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9338b49

Browse files
committedNov 15, 2017
Set short-message feature unstable
1 parent 58557fa commit 9338b49

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
 

‎src/librustc/session/config.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,15 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
14351435
Some("human") => ErrorOutputType::HumanReadable(color),
14361436
Some("json") => ErrorOutputType::Json(false),
14371437
Some("pretty-json") => ErrorOutputType::Json(true),
1438-
Some("short") => ErrorOutputType::Short(color),
1439-
1438+
Some("short") => {
1439+
if nightly_options::is_unstable_enabled(matches) {
1440+
ErrorOutputType::Short(color)
1441+
} else {
1442+
early_error(ErrorOutputType::default(),
1443+
&format!("the `-Z unstable-options` flag must also be passed to \
1444+
enable the short error message option"));
1445+
}
1446+
}
14401447
None => ErrorOutputType::HumanReadable(color),
14411448

14421449
Some(arg) => {

‎src/test/ui/short-error-format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: --error-format=short
11+
// compile-flags: --error-format=short -Zunstable-options
1212

1313
fn foo(_: u32) {}
1414

0 commit comments

Comments
 (0)
Please sign in to comment.