Skip to content

Commit b09af70

Browse files
Rollup merge of rust-lang#46005 - GuillaumeGomez:short-unstable, r=nrc
Set short-message feature unstable Fixes rust-lang#45995. r? @nrc
2 parents 8debe61 + 9338b49 commit b09af70

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
@@ -1471,8 +1471,15 @@ pub fn build_session_options_and_crate_config(matches: &getopts::Matches)
14711471
Some("human") => ErrorOutputType::HumanReadable(color),
14721472
Some("json") => ErrorOutputType::Json(false),
14731473
Some("pretty-json") => ErrorOutputType::Json(true),
1474-
Some("short") => ErrorOutputType::Short(color),
1475-
1474+
Some("short") => {
1475+
if nightly_options::is_unstable_enabled(matches) {
1476+
ErrorOutputType::Short(color)
1477+
} else {
1478+
early_error(ErrorOutputType::default(),
1479+
&format!("the `-Z unstable-options` flag must also be passed to \
1480+
enable the short error message option"));
1481+
}
1482+
}
14761483
None => ErrorOutputType::HumanReadable(color),
14771484

14781485
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)