Skip to content

Commit

Permalink
Rollup merge of rust-lang#46005 - GuillaumeGomez:short-unstable, r=nrc
Browse files Browse the repository at this point in the history
Set short-message feature unstable

Fixes rust-lang#45995.

r? @nrc
  • Loading branch information
GuillaumeGomez authored Nov 16, 2017
2 parents 8debe61 + 9338b49 commit b09af70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1471,8 +1471,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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/short-error-format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down

0 comments on commit b09af70

Please sign in to comment.