Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
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