Skip to content

Commit 2eb5b24

Browse files
committed
---
yaml --- r: 195995 b: refs/heads/beta c: 8d54ea3 h: refs/heads/master i: 195993: 45e349d 195991: 6e60b9a v: v3
1 parent c4257fb commit 2eb5b24

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
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3030
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3131
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
32-
refs/heads/beta: 6808e414c7b29bfb066c1bbabff684bde1190a4e
32+
refs/heads/beta: 8d54ea3ec9c48eaeaab8fa9061cf28c2678e8ae9
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3535
refs/heads/tmp: 9de34a84bb300bab1bf0227f577331620cd60511

branches/beta/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]

branches/beta/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;

branches/beta/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
}

branches/beta/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
}

branches/beta/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
}

branches/beta/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)