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

Change error count messages #42150

Merged
merged 1 commit into from
May 25, 2017
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ const BUG_REPORT_URL: &'static str = "https://github.com/rust-lang/rust/blob/mas
fn abort_msg(err_count: usize) -> String {
match err_count {
0 => "aborting with no errors (maybe a bug?)".to_owned(),
1 => "aborting due to previous error".to_owned(),
e => format!("aborting due to {} previous errors", e),
_ => "aborting due to previous error(s)".to_owned(),
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/librustc_errors/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,7 @@ impl Handler {

return;
}
1 => s = "aborting due to previous error".to_string(),
_ => {
s = format!("aborting due to {} previous errors", self.err_count.get());
}
_ => s = "aborting due to previous error(s)".to_string(),
}

panic!(self.fatal(&s));
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/borrowck/borrowck-in-static.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error[E0507]: cannot move out of captured outer variable in an `Fn` closure
15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable
| ^ cannot move out of captured outer variable in an `Fn` closure

error: aborting due to previous error
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error[E0507]: cannot move out of captured outer variable in an `Fn` closure
21 | y.into_iter();
| ^ cannot move out of captured outer variable in an `Fn` closure

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/check_match/issue-35609.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 mor
49 | match Some(A) {
| ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered

error: aborting due to 8 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/bad-format-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ error: expected token: `,`
|
= note: this error originates in a macro outside of the current crate

error: aborting due to 3 previous errors
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error[E0592]: duplicate definitions with name `f`
15 | impl C { fn f() {} }
| --------- other definition for `f`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/empty_span.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`,
17 | unsafe impl Send for &'static Foo { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/huge_multispan_highlight.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error: cannot borrow immutable local variable `x` as mutable
100 | let y = &mut x;
| ^ cannot borrow mutably

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/issue-11715.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
101 | }
| - first borrow ends here

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/issue-28308.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error: cannot apply unary operator `!` to type `&'static str`
|
= note: this error originates in a macro outside of the current crate

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/one_line.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error[E0499]: cannot borrow `v` as mutable more than once at a time
| | second mutable borrow occurs here
| first mutable borrow occurs here

error: aborting due to previous error
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ error[E0592]: duplicate definitions with name `baz`
43 | fn baz(&self) {}
| ---------------- other definition for `baz`

error: aborting due to 3 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/overlapping_spans.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
| | hint: to prevent move, use `ref _s` or `ref mut _s`
| cannot move out of here

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/tab.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error[E0425]: cannot find value `bar` in this scope
14 | \tbar;
| \t^^^ not found in this scope

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/unicode.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, aapcs
11 | extern "路濫狼á́́" fn foo() {}
| ^^^^^^^^

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/coercion-missing-tail-expected-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ help: consider removing this semicolon:
14 | x + 1;
| ^

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/proj-outlives-region.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ error[E0276]: impl has stricter requirements than trait
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #37166 <https://github.com/rust-lang/rust/issues/37166>

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/region-extra-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ error[E0276]: impl has stricter requirements than trait
22 | | }
| |_____^ impl has extra requirement `'a: 'b`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/region-extra.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error[E0276]: impl has stricter requirements than trait
22 | fn foo() where 'a: 'b { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/region-unrelated.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ error[E0276]: impl has stricter requirements than trait
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #37166 <https://github.com/rust-lang/rust/issues/37166>

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/reordered-type-param.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ error[E0053]: method `b` has an incompatible type for trait
= note: expected type `fn(&E, F) -> F`
found type `fn(&E, G) -> G`

error: aborting due to previous error
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error[E0276]: impl has stricter requirements than trait
25 | fn b<F: Sync, G>(&self, _x: F) -> F { panic!() } //~ ERROR E0276
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `F: std::marker::Sync`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/traits-misc-mismatch-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ error[E0276]: impl has stricter requirements than trait
76 | fn method<G: Getter<usize>>(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>`

error: aborting due to 7 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/compare-method/traits-misc-mismatch-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ error[E0276]: impl has stricter requirements than trait
26 | | }
| |_____^ impl has extra requirement `U: Iterator<B>`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/cross-crate-macro-backtrace/main.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error: invalid reference to argument `0` (no arguments given)
|
= note: this error originates in a macro outside of the current crate

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/E0178.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> Foo`
17 | z: fn() -> Foo + 'a,
| ^^^^^^^^^^^^^^^^ perhaps you forgot parentheses?

error: aborting due to 4 previous errors
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
<Bar as Foo<i32>>
<Bar as Foo<u8>>

error: aborting due to previous error
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
<Bar as Foo<u8>>
and 2 others

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-31424.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ error: cannot borrow immutable argument `self` as mutable
23 | (&mut self).bar();
| ^^^^ cannot borrow mutably

error: aborting due to 2 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-34126.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error: cannot borrow immutable argument `self` as mutable
| try removing `&mut` here
| cannot reborrow mutably

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-34337.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error: cannot borrow immutable local variable `key` as mutable
| try removing `&mut` here
| cannot reborrow mutably

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-35937.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ error: cannot assign to immutable field `s.x`
30 | s.x += 1;
| ^^^^^^^^ cannot mutably borrow immutable field

error: aborting due to 3 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-36798.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: no field `baz` on type `Foo`
17 | f.baz;
| ^^^ did you mean `bar`?

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-36798_unknown_field.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: no field `zz` on type `Foo`
17 | f.zz;
| ^^ unknown field

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-37139.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error: cannot borrow immutable local variable `x` as mutable
| try removing `&mut` here
| cannot reborrow mutably

error: aborting due to previous error
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ error[E0432]: unresolved import `Foo1`
13 | use Foo1;
| ^^^^ no `Foo1` in the root

error: aborting due to 2 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-38147-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error[E0389]: cannot borrow data mutably in a `&` reference
27 | self.s.push('x');
| ^^^^^^ assignment into an immutable reference

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-38147-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error: cannot borrow immutable borrowed content `*self.s` as mutable
17 | self.s.push('x');
| ^^^^^^ cannot borrow as mutable

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-38147-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ error: cannot borrow immutable borrowed content `*self.s` as mutable
17 | self.s.push('x');
| ^^^^^^ cannot borrow as mutable

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-38147-4.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error[E0389]: cannot borrow data mutably in a `&` reference
16 | f.s.push('x');
| ^^^ assignment into an immutable reference

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-39544.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ error: cannot assign to immutable borrowed content `*x.0`
58 | *x.0 = 1;
| ^^^^^^^^ cannot borrow as mutable

error: aborting due to 12 previous errors
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
and 2 others
= note: required by `Foo::bar`

error: aborting due to 3 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-40006.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ error[E0038]: the trait `X` cannot be made into an object
|
= note: method `xxx` has no receiver

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-40396.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ error: chained comparison operators require parentheses
|
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments

error: aborting due to 4 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-40823.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ error: cannot borrow immutable borrowed content `*buf` as mutable
13 | buf.iter_mut();
| ^^^ cannot borrow as mutable

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/issue-41679.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ error: `~` can not be used as a unary operator
|
= help: use `!` instead of `~` if you meant to perform bitwise negation

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/recursion_limit.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ error[E0275]: overflow evaluating the requirement `K: std::marker::Send`
= note: required because it appears within the type `A`
= note: required by `is_send`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/did_you_mean/recursion_limit_deref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ error[E0308]: mismatched types
= note: expected type `&Bottom`
found type `&Top`

error: aborting due to 3 previous errors
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ error[E0038]: the trait `std::marker::Copy` cannot be made into an object
|
= note: the trait cannot require that `Self : Sized`

error: aborting due to previous error
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ error: `c` does not live long enough
|
= note: values in a scope are dropped in the opposite order they are created

error: aborting due to 4 previous errors
error: aborting due to previous error(s)

Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ error[E0569]: requires an `unsafe impl` declaration due to `#[may_dangle]` attri
43 | | }
| |_^

error: aborting due to 2 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/dropck/dropck-eyepatch-reorder.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ error: `c` does not live long enough
|
= note: values in a scope are dropped in the opposite order they are created

error: aborting due to 4 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/dropck/dropck-eyepatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ error: `c` does not live long enough
|
= note: values in a scope are dropped in the opposite order they are created

error: aborting due to 4 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/fmt/format-string-error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ error: invalid format string: unmatched `}` found
= note: if you intended to print `}`, you can escape it using `}}`
= note: this error originates in a macro outside of the current crate

error: aborting due to 2 previous errors
error: aborting due to previous error(s)

2 changes: 1 addition & 1 deletion src/test/ui/fn_once-moved.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ error[E0382]: use of moved value: `debug_dump_dict`
|
= help: closure was moved because it only implements `FnOnce`

error: aborting due to previous error
error: aborting due to previous error(s)

Loading