Skip to content

Commit 2abe226

Browse files
committed
---
yaml --- r: 196222 b: refs/heads/tmp c: 8d54ea3 h: refs/heads/master v: v3
1 parent fe21877 commit 2abe226

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
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 9854143cba679834bc4ef932858cd5303f015a0e
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 6808e414c7b29bfb066c1bbabff684bde1190a4e
35+
refs/heads/tmp: 8d54ea3ec9c48eaeaab8fa9061cf28c2678e8ae9
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 53a183f0274316596bf9405944d4f0468d8c93e4
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

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