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

Fixes error count display is different when there's only one error left #118138

Merged
merged 7 commits into from
Nov 24, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ impl HandlerInner {
};
let errors = match self.deduplicated_err_count {
0 => Cow::from(""),
1 => Cow::from("aborting due to previous error"),
1 => Cow::from("aborting due to 1 previous error"),
count => Cow::from(format!("aborting due to {count} previous errors")),
};
if self.treat_err_as_bug() {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_hir_typeck/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// 8 | foo::Foo {};
/// | ^^^^^^^^ missing `you_can_use_this_field`
///
/// error: aborting due to previous error
/// error: aborting due to 1 previous error
/// ```
fn report_missing_fields(
&self,
Expand Down Expand Up @@ -2049,7 +2049,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
/// 8 | foo::Foo {};
/// | ^^^^^^^^
///
/// error: aborting due to previous error
/// error: aborting due to 1 previous error
/// ```
fn report_private_fields(
&self,
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/intrinsics/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
//! 27 | | )
//! | |_____- binding declared here but left uninitialized
//!
//! error: aborting due to previous error
//! error: aborting due to 1 previous error
//!
//! For more information about this error, try `rustc --explain E0381`.
//! ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ LL | #![deny(clippy::internal)]
= note: `#[deny(clippy::default_deprecation_reason)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `declare_deprecated_lint` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui-internal/default_lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ LL | #![deny(clippy::internal)]
= note: `#[deny(clippy::default_lint)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ LL | #![deny(clippy::internal)]
= note: `#[deny(clippy::lint_without_lint_pass)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui-internal/outer_expn_data.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::outer_expn_expn_data)]` implied by `#[deny(clippy::internal)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: expected `.`, `=`
LL | fn this_is_obviously(not: a, toml: file) {
| ^

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: invalid type: integer `42`, ex
LL | disallowed-names = 42
| ^^

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ LL | fn cognitive_complexity() {
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::cognitive_complexity)]`

error: aborting due to previous error; 2 warnings emitted
error: aborting due to 1 previous error; 2 warnings emitted

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let _ = 16777215;
= note: `-D clippy::decimal-literal-representation` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::decimal_literal_representation)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let ducks = ["quack", "quack"];
= note: `-D clippy::disallowed-names` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::disallowed_names)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let カウンタ = 10;
= note: `-D clippy::disallowed-script-idents` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::disallowed_script_idents)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ help: try
LL | /// `TestItemThingyOfCoolness` might sound cool but is not on the list and should be linted.
| ~~~~~~~~~~~~~~~~~~~~~~~~~~

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: duplicate key `cognitive-compl
LL | cognitive-complexity-threshold = 4
| ^

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ warning: error reading Clippy's configuration file: deprecated field `cyclomatic
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted
error: aborting due to 1 previous error; 1 warning emitted

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ warning: error reading Clippy's configuration file: deprecated field `cyclomatic
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted
error: aborting due to 1 previous error; 1 warning emitted

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ help: consider boxing the large fields to reduce the total size of the enum
LL | B(Box<[u8; 501]>),
| ~~~~~~~~~~~~~~

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LL | fn g(_: bool, _: bool) {}
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::fn_params_excessive_bools)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ LL | if x.get() {
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ifs_same_cond)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ help: add a type parameter
LL | fn t<{ /* Generic name */ }: Trait>(_: impl Trait);
| +++++++++++++++++++++++++++++++

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: error reading Clippy's configuration file: not a valid Rust version
LL | msrv = "invalid.version"
| ^^^^^^^^^^^^^^^^^

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | should_warn().await;
= note: `-D clippy::large-futures` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_futures)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ LL | | }
= note: `-D clippy::large-stack-frames` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_stack_frames)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | fn f2(_v: [u8; 513]) {}
= note: `-D clippy::large-types-passed-by-value` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::large_types_passed_by_value)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ LL | | };
= note: `-D clippy::manual-let-else` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_let_else)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ help: and replace the index expressions here
LL | println!("{}", slice_7);
| ~~~~~~~

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let _: Option<u64> = Some(&16).map(|b| *b);
= note: `-D clippy::map-clone` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::map_clone)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LL | fn f2() -> Result<(), [u8; 512]> {
= note: `-D clippy::result-large-err` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::result_large_err)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ LL ~ unit_fn_block();
LL ~ }
|

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ LL | | }
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::struct_excessive_bools)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | fn f(x: Box<[u8; 500]>) {}
= note: `-D clippy::boxed-local` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::boxed_local)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let x = vec![0u8; 500];
= note: `-D clippy::useless-vec` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::useless_vec)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | fn too_many(p1: u8, p2: u8, p3: u8, p4: u8, p5: u8, p6: u8, p7: u8, p8: u8,
= note: `-D clippy::too-many-arguments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::too_many_arguments)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | fn f2(_: (u8, (u8, (u8, (u8, (u8, (u8, u8))))))) {}
= note: `-D clippy::type-complexity` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::type_complexity)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LL | T: Unpin + PartialEq,
= note: `-D clippy::type-repetition-in-bounds` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::type_repetition_in_bounds)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LL | fn f() -> Box<[u8; 64]> {
= note: `-D clippy::unnecessary-box-returns` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_box_returns)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let _ = v & 0b111111 == 0;
= note: `-D clippy::verbose-bit-mask` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::verbose_bit_mask)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | use prelude::*;
= note: `-D clippy::wildcard-imports` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::wildcard_imports)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ help: if you would like to deref, try using `&**`
LL | let x: &str = &**s;
| ~~~~

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/char_lit_as_u8.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LL | let _ = '❤' as u8;
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::char_lit_as_u8)]`

error: aborting due to previous error
error: aborting due to 1 previous error

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ LL | fn kaboom() {
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::cognitive_complexity)]`

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/copy_iterator.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ LL | | }
= note: `-D clippy::copy-iterator` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::copy_iterator)]`

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-10148.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ LL | println!(with_span!(""something ""));
= note: `-D clippy::println-empty-string` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::println_empty_string)]`

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-11422.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ LL - fn gen() -> impl PartialOrd + PartialEq + Debug {}
LL + fn gen() -> impl PartialOrd + Debug {}
|

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-2774.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ LL - pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
LL + pub fn add_barfoos_to_foos(bars: &HashSet<&Bar>) {
|

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-3717.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ help: ...and use generic constructor
LL | let _: HashSet<usize> = HashSet::default();
| ~~~~~~~~~~~~~~~~~~

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-3891.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ LL | 1x;
|
= help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-5497.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ LL | const OOB: i32 = [1][1] + T::OOB;
|
= note: `#[deny(unconditional_panic)]` on by default

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-5835.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | /// 位
= note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]`

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-5872.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>().is_empty();
= note: `-D clippy::needless-collect` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_collect)]`

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-6254.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ LL | FOO_REF_REF => {},
= note: `-D indirect-structural-match` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(indirect_structural_match)]`

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-6255.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ LL | define_other_core!();
|
= note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/crashes/ice-6256.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ LL | let f = |x: &dyn TT| x.func();
| | let's call the lifetime of this reference `'1`
| `x` is a reference that is only valid in the closure body

error: aborting due to previous error
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0521`.
Loading
Loading