Skip to content

Commit 0c5f1f3

Browse files
NoratriebadrianEffe
andcommitted
Show number in error message even for one error
Co-authored-by: Adrian <[email protected]>
1 parent e24e5af commit 0c5f1f3

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ impl HandlerInner {
14651465
};
14661466
let errors = match self.deduplicated_err_count {
14671467
0 => Cow::from(""),
1468-
1 => Cow::from("aborting due to previous error"),
1468+
1 => Cow::from("aborting due to 1 previous error"),
14691469
count => Cow::from(format!("aborting due to {count} previous errors")),
14701470
};
14711471
if self.treat_err_as_bug() {

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,7 +1936,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
19361936
/// 8 | foo::Foo {};
19371937
/// | ^^^^^^^^ missing `you_can_use_this_field`
19381938
///
1939-
/// error: aborting due to previous error
1939+
/// error: aborting due to 1 previous error
19401940
/// ```
19411941
fn report_missing_fields(
19421942
&self,
@@ -2053,7 +2053,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20532053
/// 8 | foo::Foo {};
20542054
/// | ^^^^^^^^
20552055
///
2056-
/// error: aborting due to previous error
2056+
/// error: aborting due to 1 previous error
20572057
/// ```
20582058
fn report_private_fields(
20592059
&self,

library/core/src/intrinsics/mir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
//! 27 | | )
194194
//! | |_____- binding declared here but left uninitialized
195195
//!
196-
//! error: aborting due to previous error
196+
//! error: aborting due to 1 previous error
197197
//!
198198
//! For more information about this error, try `rustc --explain E0381`.
199199
//! ```

tests/ui/associated-types/issue-36499.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: aborting due to previous error
1+
// error-pattern: aborting due to 1 previous error
22

33
fn main() {
44
2 + +2;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Fixed in #66054.
22
// ignore-tidy-trailing-newlines
33
// error-pattern: this file contains an unclosed delimiter
4-
// error-pattern: aborting due to previous error
4+
// error-pattern: aborting due to 1 previous error
55
#[Ѕ

tests/ui/parser/issues/issue-62524.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ignore-tidy-trailing-newlines
2-
// error-pattern: aborting due to previous error
2+
// error-pattern: aborting due to 1 previous error
33
#![allow(uncommon_codepoints)]
44

55
y![

tests/ui/parser/issues/issue-63135.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// error-pattern: this file contains an unclosed delimiter
2-
// error-pattern: aborting due to previous error
2+
// error-pattern: aborting due to 1 previous error
33
fn i(n{...,f #
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// ignore-tidy-trailing-newlines
22
// error-pattern: this file contains an unclosed delimiter
3-
// error-pattern: aborting due to previous error
3+
// error-pattern: aborting due to 1 previous error
44
fn main((ؼ

0 commit comments

Comments
 (0)