Skip to content

Commit e04daae

Browse files
committed
---
yaml --- r: 195519 b: refs/heads/master c: 8d54ea3 h: refs/heads/master i: 195517: f349b7d 195515: bf9be61 195511: 99a66b3 195503: 58ddf8a 195487: 9fbe0d7 195455: 7baa877 v: v3
1 parent c6fb2b0 commit e04daae

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6808e414c7b29bfb066c1bbabff684bde1190a4e
2+
refs/heads/master: 8d54ea3ec9c48eaeaab8fa9061cf28c2678e8ae9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b3317d68910900f135f9f38e43a7a699bc736b4a
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf

trunk/src/libcoretest/num/uint_macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mod tests {
2020
fn test_overflows() {
2121
assert!(MAX > 0);
2222
assert!(MIN <= 0);
23-
assert!(MIN + MAX + 1 == 0);
23+
assert!((MIN + MAX).wrapping_add(1) == 0);
2424
}
2525

2626
#[test]

trunk/src/libstd/old_io/extensions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ mod bench {
519519
({
520520
use super::u64_from_be_bytes;
521521

522-
let data = (0..$stride*100+$start_index).collect::<Vec<_>>();
522+
let len = $stride.wrapping_mul(100).wrapping_add($start_index);
523+
let data = (0..len).collect::<Vec<_>>();
523524
let mut sum = 0;
524525
$b.iter(|| {
525526
let mut i = $start_index;

trunk/src/test/compile-fail/non-constant-enum-for-vec-repeat.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// Note: This test is checking that we forbid a coding pattern that
12+
// Issue #5873 explicitly wants to allow.
13+
1114
enum State { ST_NULL, ST_WHITESPACE }
1215

1316
fn main() {
1417
[State::ST_NULL; (State::ST_WHITESPACE as usize)];
15-
//~^ ERROR expected constant integer for repeat count, found non-constant expression
18+
//~^ ERROR expected constant integer for repeat count, but non-constant path
1619
}

trunk/src/test/compile-fail/non-constant-expr-for-vec-repeat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
fn main() {
1414
fn bar(n: usize) {
15-
let _x = [0; n]; //~ ERROR expected constant integer for repeat count, found variable
15+
let _x = [0; n];
16+
//~^ ERROR expected constant integer for repeat count, found variable
1617
}
1718
}

trunk/src/test/run-pass/big-literals.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010

1111
// pretty-expanded FIXME #23616
1212

13+
#![feature(core)]
14+
15+
// Catch mistakes in the overflowing literals lint.
16+
#![deny(overflowing_literals)]
17+
1318
pub fn main() {
1419
assert_eq!(0xffffffff, (-1 as u32));
1520
assert_eq!(4294967295, (-1 as u32));
1621
assert_eq!(0xffffffffffffffff, (-1 as u64));
1722
assert_eq!(18446744073709551615, (-1 as u64));
1823

19-
assert_eq!(-2147483648 - 1, 2147483647);
24+
assert_eq!((-2147483648).wrapping_sub(1), 2147483647);
2025
}

trunk/src/test/run-pass/small-enum-range-edge.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ static CLs: Es = Es::Ls;
2929
static CHs: Es = Es::Hs;
3030

3131
pub fn main() {
32-
assert_eq!((Eu::Hu as u8) + 1, Eu::Lu as u8);
33-
assert_eq!((Es::Hs as i8) + 1, Es::Ls as i8);
32+
assert_eq!((Eu::Hu as u8).wrapping_add(1), Eu::Lu as u8);
33+
assert_eq!((Es::Hs as i8).wrapping_add(1), Es::Ls as i8);
3434
assert_eq!(CLu as u8, Eu::Lu as u8);
3535
assert_eq!(CHu as u8, Eu::Hu as u8);
3636
assert_eq!(CLs as i8, Es::Ls as i8);

0 commit comments

Comments
 (0)