Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize short error format #49546

Merged
merged 2 commits into from
May 31, 2018
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
14 changes: 1 addition & 13 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1799,19 +1799,7 @@ pub fn build_session_options_and_crate_config(
Some("human") => ErrorOutputType::HumanReadable(color),
Some("json") => ErrorOutputType::Json(false),
Some("pretty-json") => ErrorOutputType::Json(true),
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"
),
);
}
}
Some("short") => ErrorOutputType::Short(color),
None => ErrorOutputType::HumanReadable(color),

Some(arg) => early_error(
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ impl EmitterWriter {
}
} else {
buffer.prepend(0,
&format!("{}:{}:{} - ",
&format!("{}:{}:{}: ",
loc.file.name,
cm.doctest_offset_line(loc.line),
loc.col.0 + 1),
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 -Zunstable-options
// compile-flags: --error-format=short

fn foo(_: u32) {}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/short-error-format.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$DIR/short-error-format.rs:16:9 - error[E0308]: mismatched types
$DIR/short-error-format.rs:18:7 - error[E0599]: no method named `salut` found for type `u32` in the current scope
$DIR/short-error-format.rs:16:9: error[E0308]: mismatched types
$DIR/short-error-format.rs:18:7: error[E0599]: no method named `salut` found for type `u32` in the current scope
error: aborting due to 2 previous errors