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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

tests/ui/argument-suggestions/complex.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ help: did you mean
1414
LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {});
1515
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616

17-
error: aborting due to previous error
17+
error: aborting due to 1 previous error
1818

1919
For more information about this error, try `rustc --explain E0308`.

tests/ui/argument-suggestions/display-is-suggestable.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ help: provide the argument
1414
LL | foo(/* &dyn std::fmt::Display + Send */);
1515
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616

17-
error: aborting due to previous error
17+
error: aborting due to 1 previous error
1818

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

tests/ui/argument-suggestions/issue-112507.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ LL ~ ,
2222
LL ~ None);
2323
|
2424

25-
error: aborting due to previous error
25+
error: aborting due to 1 previous error
2626

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

tests/ui/argument-suggestions/issue-96638.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ help: provide the argument
1616
LL | f(/* usize */, &x, /* usize */);
1717
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/argument-suggestions/issue-97197.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ help: provide the arguments
1414
LL | g((), /* bool */, /* bool */, /* bool */, /* bool */, ());
1515
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616

17-
error: aborting due to previous error
17+
error: aborting due to 1 previous error
1818

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

tests/ui/argument-suggestions/issue-97484.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ LL - foo(&&A, B, C, D, E, F, G);
2323
LL + foo(&&A, D, /* &E */, G);
2424
|
2525

26-
error: aborting due to previous error
26+
error: aborting due to 1 previous error
2727

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

tests/ui/argument-suggestions/issue-98894.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ help: provide the argument
1414
LL | (|_, ()| ())(if true {} else {return;}, ());
1515
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616

17-
error: aborting due to previous error
17+
error: aborting due to 1 previous error
1818

1919
For more information about this error, try `rustc --explain E0057`.

tests/ui/argument-suggestions/issue-98897.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ help: provide the argument
1414
LL | (|_, ()| ())([return, ()], ());
1515
| ~~~~~~~~~~~~~~~~~~
1616

17-
error: aborting due to previous error
17+
error: aborting due to 1 previous error
1818

1919
For more information about this error, try `rustc --explain E0057`.

tests/ui/argument-suggestions/issue-99482.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ help: provide the argument
1414
LL | let _f = f((), main);
1515
| ~~~~~~~~~~
1616

17-
error: aborting due to previous error
17+
error: aborting due to 1 previous error
1818

1919
For more information about this error, try `rustc --explain E0057`.

tests/ui/argument-suggestions/too-long.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ help: consider dereferencing the borrow
1919
LL | qux.foo(a, b, c, d, e, *f, g, h, i, j, k, l);
2020
| +
2121

22-
error: aborting due to previous error
22+
error: aborting due to 1 previous error
2323

2424
For more information about this error, try `rustc --explain E0308`.

tests/ui/argument-suggestions/two-mismatch-notes.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ note: function defined here
2424
LL | fn foo(_: fn(i32), _: Wrapper<i32>) {}
2525
| ^^^ ---------- ---------------
2626

27-
error: aborting due to previous error
27+
error: aborting due to 1 previous error
2828

2929
For more information about this error, try `rustc --explain E0308`.

tests/ui/array-slice-vec/array_const_index-0.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ error[E0080]: evaluation of constant value failed
44
LL | const B: i32 = (&A)[1];
55
| ^^^^^^^ index out of bounds: the length is 0 but the index is 1
66

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

99
For more information about this error, try `rustc --explain E0080`.

tests/ui/array-slice-vec/array_const_index-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ error[E0080]: evaluation of constant value failed
44
LL | const B: i32 = A[1];
55
| ^^^^ index out of bounds: the length is 0 but the index is 1
66

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

99
For more information about this error, try `rustc --explain E0080`.

tests/ui/array-slice-vec/match_arr_unknown_len.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ LL | [1, 2] => true,
77
= note: expected array `[u32; 2]`
88
found array `[u32; N]`
99

10-
error: aborting due to previous error
10+
error: aborting due to 1 previous error
1111

1212
For more information about this error, try `rustc --explain E0308`.

tests/ui/array-slice-vec/slice-mut-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ help: consider changing this to be a mutable reference
99
LL | let x: &[isize] = &mut [1, 2, 3, 4, 5];
1010
| +++
1111

12-
error: aborting due to previous error
12+
error: aborting due to 1 previous error
1313

1414
For more information about this error, try `rustc --explain E0596`.

tests/ui/array-slice-vec/slice-mut.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ LL | let y: &mut[_] = &x[2..4];
99
= note: expected mutable reference `&mut [_]`
1010
found reference `&[isize]`
1111

12-
error: aborting due to previous error
12+
error: aborting due to 1 previous error
1313

1414
For more information about this error, try `rustc --explain E0308`.

tests/ui/array-slice-vec/slice-to-vec-comparison.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ LL | a > b;
77
= note: expected reference `&[_; 0]`
88
found reference `&Vec<u8>`
99

10-
error: aborting due to previous error
10+
error: aborting due to 1 previous error
1111

1212
For more information about this error, try `rustc --explain E0308`.

tests/ui/array-slice-vec/vec-macro-with-comma-only.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ LL | vec![,];
66
|
77
= note: while trying to match end of macro
88

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

tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ LL | for x in &mut xs {
99
LL | xs.push(1)
1010
| ^^ second mutable borrow occurs here
1111

12-
error: aborting due to previous error
12+
error: aborting due to 1 previous error
1313

1414
For more information about this error, try `rustc --explain E0499`.

tests/ui/array-slice-vec/vec-res-add.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ LL | let k = i + j;
66
| |
77
| Vec<R>
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 E0369`.

tests/ui/array-slice-vec/vector-no-ann.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ help: consider giving `_foo` an explicit type, where the type for type parameter
99
LL | let _foo: Vec<T> = Vec::new();
1010
| ++++++++
1111

12-
error: aborting due to previous error
12+
error: aborting due to 1 previous error
1313

1414
For more information about this error, try `rustc --explain E0282`.

tests/ui/asm/issue-113788.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ error[E0412]: cannot find type `PEB` in this scope
44
LL | let peb: *const PEB;
55
| ^^^ not found in this scope
66

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

99
For more information about this error, try `rustc --explain E0412`.

tests/ui/asm/issue-72570.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error: invalid register `invalid`: unknown register
44
LL | asm!("", in("invalid") "".len());
55
| ^^^^^^^^^^^^^^^^^^^^^^
66

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

tests/ui/asm/issue-85247.rwpi.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error: cannot use register `r9`: the RWPI static base register (r9) cannot be us
44
LL | asm!("", out("r9") _);
55
| ^^^^^^^^^^^
66

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

tests/ui/asm/issue-87802.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ LL | asm!("/* {0} */", out(reg) x);
66
|
77
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
88

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

tests/ui/asm/issue-99071.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error: cannot use register `r8`: high registers (r8+) can only be used as clobbe
44
LL | asm!("", in("r8") 0);
55
| ^^^^^^^^^^
66

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

tests/ui/asm/issue-99122.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ LL | let pointer = 1u32 as *const _;
66
|
77
= note: the type information given here is insufficient to check whether the pointer cast is valid
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 E0641`.

tests/ui/asm/reg-conflict.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ LL | asm!("", out("d0") _, out("s1") _);
66
| |
77
| register `d0`
88

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

tests/ui/assign-imm-local-twice.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ LL | println!("v={}", v);
1010
LL | v = 2;
1111
| ^^^^^ cannot assign twice to immutable variable
1212

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

1515
For more information about this error, try `rustc --explain E0384`.

tests/ui/associated-consts/associated-const-ambiguity-report.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ LL | const X: i32 = <i32 as Bar>::ID;
2121
LL | const X: i32 = <i32 as Foo>::ID;
2222
| ~~~~~~~~~~~~~~
2323

24-
error: aborting due to previous error
24+
error: aborting due to 1 previous error
2525

2626
For more information about this error, try `rustc --explain E0034`.

tests/ui/associated-consts/associated-const-array-len.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ help: this trait has no implementations, consider adding one
1010
LL | trait Foo {
1111
| ^^^^^^^^^
1212

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

1515
For more information about this error, try `rustc --explain E0277`.

tests/ui/associated-consts/associated-const-dead-code.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ note: the lint level is defined here
1212
LL | #![deny(dead_code)]
1313
| ^^^^^^^^^
1414

15-
error: aborting due to previous error
15+
error: aborting due to 1 previous error
1616

tests/ui/associated-consts/associated-const-generic-obligations.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ LL | const FROM: Self::Out;
1212
= note: expected associated type `<T as Foo>::Out`
1313
found reference `&'static str`
1414

15-
error: aborting due to previous error
15+
error: aborting due to 1 previous error
1616

1717
For more information about this error, try `rustc --explain E0326`.

tests/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ LL | impl<'a> Foo for &'a () {
1313
| ^^
1414
= note: ...does not necessarily outlive the static lifetime
1515

16-
error: aborting due to previous error
16+
error: aborting due to 1 previous error
1717

1818
For more information about this error, try `rustc --explain E0308`.

tests/ui/associated-consts/associated-const-impl-wrong-type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ note: type in trait
1010
LL | const BAR: u32;
1111
| ^^^
1212

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

1515
For more information about this error, try `rustc --explain E0326`.

tests/ui/associated-consts/associated-const-in-trait.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ LL | const N: usize;
1313
| ^ ...because it contains this associated `const`
1414
= help: consider moving `N` to another trait
1515

16-
error: aborting due to previous error
16+
error: aborting due to 1 previous error
1717

1818
For more information about this error, try `rustc --explain E0038`.

tests/ui/associated-consts/associated-const-no-item.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ note: `Foo` defines an item `ID`, perhaps you need to implement it
1111
LL | trait Foo {
1212
| ^^^^^^^^^
1313

14-
error: aborting due to previous error
14+
error: aborting due to 1 previous error
1515

1616
For more information about this error, try `rustc --explain E0599`.

tests/ui/associated-consts/associated-const-private-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ LL | const ID: i32 = 1;
77
LL | assert_eq!(1, bar1::Foo::ID);
88
| ^^ private associated constant
99

10-
error: aborting due to previous error
10+
error: aborting due to 1 previous error
1111

1212
For more information about this error, try `rustc --explain E0624`.

tests/ui/associated-consts/associated-const-type-parameter-arrays-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ LL | let _array = [4; <A as Foo>::Y];
66
|
77
= note: this may fail depending on what value the parameter takes
88

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

tests/ui/associated-consts/associated-const-type-parameter-arrays.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ LL | let _array: [u32; <A as Foo>::Y];
77
= note: type parameters may not be used in const expressions
88
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
99

10-
error: aborting due to previous error
10+
error: aborting due to 1 previous error
1111

0 commit comments

Comments
 (0)