Skip to content

Commit 41fe4b7

Browse files
authored
Auto merge of #35283 - shantanuraj:master, r=jonathandturner
Update wording on E0080 Part of #35223 Update wording on error E0080. Change "attempted" to "attempt" r? @GuillaumeGomez
2 parents 802d081 + e5e4ccc commit 41fe4b7

35 files changed

+105
-105
lines changed

src/librustc/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ code example:
2323
#[deny(const_err)]
2424
2525
const X: i32 = 42 / 0;
26-
// error: attempted to divide by zero in a constant expression
26+
// error: attempt to divide by zero in a constant expression
2727
```
2828
"##,
2929

src/librustc_const_math/err.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ impl ConstMathErr {
5757
UnequalTypes(BitOr) => "tried to bitor two values of different types",
5858
UnequalTypes(BitXor) => "tried to xor two values of different types",
5959
UnequalTypes(_) => unreachable!(),
60-
Overflow(Add) => "attempted to add with overflow",
61-
Overflow(Sub) => "attempted to subtract with overflow",
62-
Overflow(Mul) => "attempted to multiply with overflow",
63-
Overflow(Div) => "attempted to divide with overflow",
64-
Overflow(Rem) => "attempted to calculate the remainder with overflow",
65-
Overflow(Neg) => "attempted to negate with overflow",
66-
Overflow(Shr) => "attempted to shift right with overflow",
67-
Overflow(Shl) => "attempted to shift left with overflow",
60+
Overflow(Add) => "attempt to add with overflow",
61+
Overflow(Sub) => "attempt to subtract with overflow",
62+
Overflow(Mul) => "attempt to multiply with overflow",
63+
Overflow(Div) => "attempt to divide with overflow",
64+
Overflow(Rem) => "attempt to calculate the remainder with overflow",
65+
Overflow(Neg) => "attempt to negate with overflow",
66+
Overflow(Shr) => "attempt to shift right with overflow",
67+
Overflow(Shl) => "attempt to shift left with overflow",
6868
Overflow(_) => unreachable!(),
69-
ShiftNegative => "attempted to shift by a negative amount",
70-
DivisionByZero => "attempted to divide by zero",
71-
RemainderByZero => "attempted to calculate the remainder with a divisor of zero",
69+
ShiftNegative => "attempt to shift by a negative amount",
70+
DivisionByZero => "attempt to divide by zero",
71+
RemainderByZero => "attempt to calculate the remainder with a divisor of zero",
7272
UnsignedNegation => "unary negation of unsigned integer",
7373
ULitOutOfRange(ast::UintTy::U8) => "literal out of range for u8",
7474
ULitOutOfRange(ast::UintTy::U16) => "literal out of range for u16",

src/librustc_trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1512,7 +1512,7 @@ fn trans_unary<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
15121512
C_integral(llty, min, true), debug_loc);
15131513
with_cond(bcx, is_min, |bcx| {
15141514
let msg = InternedString::new(
1515-
"attempted to negate with overflow");
1515+
"attempt to negate with overflow");
15161516
controlflow::trans_fail(bcx, expr_info(expr), msg)
15171517
})
15181518
} else {

src/test/compile-fail/const-err-early.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#![feature(const_indexing)]
1212
#![deny(const_err)]
1313

14-
pub const A: i8 = -std::i8::MIN; //~ ERROR attempted to negate with overflow
15-
pub const B: u8 = 200u8 + 200u8; //~ ERROR attempted to add with overflow
16-
pub const C: u8 = 200u8 * 4; //~ ERROR attempted to multiply with overflow
17-
pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR attempted to subtract with overflow
14+
pub const A: i8 = -std::i8::MIN; //~ ERROR attempt to negate with overflow
15+
pub const B: u8 = 200u8 + 200u8; //~ ERROR attempt to add with overflow
16+
pub const C: u8 = 200u8 * 4; //~ ERROR attempt to multiply with overflow
17+
pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR attempt to subtract with overflow
1818
pub const E: u8 = [5u8][1];
1919
//~^ ERROR index out of bounds: the len is 1 but the index is 1
2020

src/test/compile-fail/const-err-multi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#![deny(const_err)]
1212

13-
pub const A: i8 = -std::i8::MIN; //~ ERROR attempted to negate with overflow
13+
pub const A: i8 = -std::i8::MIN; //~ ERROR attempt to negate with overflow
1414
pub const B: i8 = A;
1515
pub const C: u8 = A as u8;
1616
pub const D: i8 = 50 - A;

src/test/compile-fail/const-err.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ const FOO: u8 = [5u8][1];
3030
fn main() {
3131
let a = -std::i8::MIN;
3232
//~^ WARN this expression will panic at run-time
33-
//~| attempted to negate with overflow
33+
//~| attempt to negate with overflow
3434
let b = 200u8 + 200u8 + 200u8;
3535
//~^ WARN this expression will panic at run-time
36-
//~| attempted to add with overflow
36+
//~| attempt to add with overflow
3737
//~^^^ WARN this expression will panic at run-time
38-
//~| attempted to add with overflow
38+
//~| attempt to add with overflow
3939
let c = 200u8 * 4;
4040
//~^ WARN this expression will panic at run-time
41-
//~| attempted to multiply with overflow
41+
//~| attempt to multiply with overflow
4242
let d = 42u8 - (42u8 + 1);
4343
//~^ WARN this expression will panic at run-time
44-
//~| attempted to subtract with overflow
44+
//~| attempt to subtract with overflow
4545
let _e = [5u8][1];
4646
//~^ WARN this expression will panic at run-time
4747
//~| index out of bounds: the len is 1 but the index is 1

src/test/compile-fail/const-err2.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ fn black_box<T>(_: T) {
1818

1919
fn main() {
2020
let a = -std::i8::MIN;
21-
//~^ ERROR attempted to negate with overflow
21+
//~^ ERROR attempt to negate with overflow
2222
let b = 200u8 + 200u8 + 200u8;
23-
//~^ ERROR attempted to add with overflow
24-
//~| ERROR attempted to add with overflow
23+
//~^ ERROR attempt to add with overflow
24+
//~| ERROR attempt to add with overflow
2525
let c = 200u8 * 4;
26-
//~^ ERROR attempted to multiply with overflow
26+
//~^ ERROR attempt to multiply with overflow
2727
let d = 42u8 - (42u8 + 1);
28-
//~^ ERROR attempted to subtract with overflow
28+
//~^ ERROR attempt to subtract with overflow
2929
let _e = [5u8][1];
3030
black_box(a);
3131
black_box(b);

src/test/compile-fail/const-eval-overflow-2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ use std::{u8, u16, u32, u64, usize};
2020
const NEG_128: i8 = -128;
2121
const NEG_NEG_128: i8 = -NEG_128;
2222
//~^ ERROR constant evaluation error
23-
//~| attempted to negate with overflow
23+
//~| attempt to negate with overflow
2424
//~| ERROR constant evaluation error
25-
//~| attempted to negate with overflow
25+
//~| attempt to negate with overflow
2626
//~| ERROR constant evaluation error
27-
//~| attempted to negate with overflow
27+
//~| attempt to negate with overflow
2828

2929
fn main() {
3030
match -128i8 {

src/test/compile-fail/const-eval-overflow-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// self-hosted and a cross-compiled setup; therefore resorting to
1818
// error-pattern for now.
1919

20-
// error-pattern: attempted to add with overflow
20+
// error-pattern: attempt to add with overflow
2121

2222
#![allow(unused_imports)]
2323

src/test/compile-fail/const-eval-overflow-4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::{u8, u16, u32, u64, usize};
2323

2424
const A_I8_T
2525
: [u32; (i8::MAX as i8 + 1i8) as usize]
26-
//~^ ERROR error evaluating count: attempted to add with overflow
26+
//~^ ERROR error evaluating count: attempt to add with overflow
2727
= [0; (i8::MAX as usize) + 1];
2828

2929
fn main() {

0 commit comments

Comments
 (0)