Skip to content

Commit 0345dac

Browse files
Rollup merge of #49546 - GuillaumeGomez:stabilize-short-error-format, r=oli-obk
Stabilize short error format r? @oli-obk Added in #44636
2 parents 5342d40 + 426b63f commit 0345dac

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

src/librustc/session/config.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -1799,19 +1799,7 @@ pub fn build_session_options_and_crate_config(
17991799
Some("human") => ErrorOutputType::HumanReadable(color),
18001800
Some("json") => ErrorOutputType::Json(false),
18011801
Some("pretty-json") => ErrorOutputType::Json(true),
1802-
Some("short") => {
1803-
if nightly_options::is_unstable_enabled(matches) {
1804-
ErrorOutputType::Short(color)
1805-
} else {
1806-
early_error(
1807-
ErrorOutputType::default(),
1808-
&format!(
1809-
"the `-Z unstable-options` flag must also be passed to \
1810-
enable the short error message option"
1811-
),
1812-
);
1813-
}
1814-
}
1802+
Some("short") => ErrorOutputType::Short(color),
18151803
None => ErrorOutputType::HumanReadable(color),
18161804

18171805
Some(arg) => early_error(

src/librustc_errors/emitter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ impl EmitterWriter {
10471047
}
10481048
} else {
10491049
buffer.prepend(0,
1050-
&format!("{}:{}:{} - ",
1050+
&format!("{}:{}:{}: ",
10511051
loc.file.name,
10521052
cm.doctest_offset_line(loc.line),
10531053
loc.col.0 + 1),

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 -Zunstable-options
11+
// compile-flags: --error-format=short
1212

1313
fn foo(_: u32) {}
1414

src/test/ui/short-error-format.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
$DIR/short-error-format.rs:16:9 - error[E0308]: mismatched types
2-
$DIR/short-error-format.rs:18:7 - error[E0599]: no method named `salut` found for type `u32` in the current scope
1+
$DIR/short-error-format.rs:16:9: error[E0308]: mismatched types
2+
$DIR/short-error-format.rs:18:7: error[E0599]: no method named `salut` found for type `u32` in the current scope
33
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)