Skip to content

Commit 41e8d15

Browse files
NoratriebadrianEffe
andcommitted
Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
1 parent 4fd68eb commit 41e8d15

File tree

5,025 files changed

+5026
-5026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,025 files changed

+5026
-5026
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
@@ -1932,7 +1932,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
19321932
/// 8 | foo::Foo {};
19331933
/// | ^^^^^^^^ missing `you_can_use_this_field`
19341934
///
1935-
/// error: aborting due to previous error
1935+
/// error: aborting due to 1 previous error
19361936
/// ```
19371937
fn report_missing_fields(
19381938
&self,
@@ -2049,7 +2049,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20492049
/// 8 | foo::Foo {};
20502050
/// | ^^^^^^^^
20512051
///
2052-
/// error: aborting due to previous error
2052+
/// error: aborting due to 1 previous error
20532053
/// ```
20542054
fn report_private_fields(
20552055
&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/abi/abi-typo-unstable.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ LL | extern "rust-intrinsec" fn rust_intrinsic() {}
66
|
77
= note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions.
88

9-
error: aborting due to previous error
9+
error: aborting due to 1 previous error
1010

1111
For more information about this error, try `rustc --explain E0703`.

tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ LL | fn oom() -> ! {
1616
| ^^^
1717
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
1818

19-
error: aborting due to previous error
19+
error: aborting due to 1 previous error
2020

2121
For more information about this error, try `rustc --explain E0061`.

tests/ui/allocator/allocator-args.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error: malformed `global_allocator` attribute input
44
LL | #[global_allocator(malloc)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[global_allocator]`
66

7-
error: aborting due to previous error
7+
error: aborting due to 1 previous error
88

tests/ui/allocator/function-allocator.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error: allocators must be statics
44
LL | fn foo() {}
55
| ^^^^^^^^^^^
66

7-
error: aborting due to previous error
7+
error: aborting due to 1 previous error
88

tests/ui/allocator/two-allocators.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ LL | static B: System = System;
1010
|
1111
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
1212

13-
error: aborting due to previous error
13+
error: aborting due to 1 previous error
1414

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
error: the `#[global_allocator]` in this crate conflicts with global allocator in: system_allocator
22

3-
error: aborting due to previous error
3+
error: aborting due to 1 previous error
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
error: the `#[global_allocator]` in system_allocator conflicts with global allocator in: system_allocator2
22

3-
error: aborting due to previous error
3+
error: aborting due to 1 previous error
44

0 commit comments

Comments
 (0)