Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit af780e5

Browse files
committedNov 29, 2020
Auto merge of rust-lang#78380 - bstrie:rm-old-num-const-from-tests, r=jyn514
Update tests to remove old numeric constants Part of rust-lang#68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2 parents 2e57231 + 90a2e5e commit af780e5

File tree

106 files changed

+463
-528
lines changed

Some content is hidden

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

106 files changed

+463
-528
lines changed
 

‎src/test/ui/array-slice-vec/bounds-check-no-overflow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// error-pattern:index out of bounds
33
// ignore-emscripten no processes
44

5-
use std::usize;
65
use std::mem::size_of;
76

87
fn main() {

‎src/test/ui/associated-consts/issue-69020-assoc-const-arith-overflow.noopt.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
error: this arithmetic operation will overflow
2-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:22
2+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:27:22
33
|
44
LL | const NEG: i32 = -i32::MIN + T::NEG;
55
| ^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
66
|
77
= note: `#[deny(arithmetic_overflow)]` on by default
88

99
error: this arithmetic operation will overflow
10-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:31:35
10+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:29:35
1111
|
1212
LL | const NEG_REV: i32 = T::NEG + (-i32::MIN);
1313
| ^^^^^^^^^^^ attempt to negate `i32::MIN`, which would overflow
1414

1515
error: this arithmetic operation will overflow
16-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:22
16+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:32:22
1717
|
1818
LL | const ADD: i32 = (i32::MAX+1) + T::ADD;
1919
| ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
2020

2121
error: this arithmetic operation will overflow
22-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:36:36
22+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:34:36
2323
|
2424
LL | const ADD_REV: i32 = T::ADD + (i32::MAX+1);
2525
| ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
2626

2727
error: this operation will panic at runtime
28-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:22
28+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:37:22
2929
|
3030
LL | const DIV: i32 = (1/0) + T::DIV;
3131
| ^^^^^ attempt to divide `1_i32` by zero
3232
|
3333
= note: `#[deny(unconditional_panic)]` on by default
3434

3535
error: this operation will panic at runtime
36-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:41:35
36+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:39:35
3737
|
3838
LL | const DIV_REV: i32 = T::DIV + (1/0);
3939
| ^^^^^ attempt to divide `1_i32` by zero
4040

4141
error: this operation will panic at runtime
42-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:22
42+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:42:22
4343
|
4444
LL | const OOB: i32 = [1][1] + T::OOB;
4545
| ^^^^^^ index out of bounds: the length is 1 but the index is 1
4646

4747
error: this operation will panic at runtime
48-
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:46:35
48+
--> $DIR/issue-69020-assoc-const-arith-overflow.rs:44:35
4949
|
5050
LL | const OOB_REV: i32 = T::OOB + [1][1];
5151
| ^^^^^^ index out of bounds: the length is 1 but the index is 1
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.