From db2527add3a9442266e7d31a218b91cda255bd4a Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Wed, 24 Aug 2016 22:38:14 +0300 Subject: [PATCH] Fix parse-fail and compile-fail tests --- src/test/compile-fail/const-tup-index-span.rs | 2 +- src/test/compile-fail/oversized-literal.rs | 13 ------------- src/test/parse-fail/int-literal-too-large-span.rs | 4 ++-- src/test/parse-fail/issue-5544-a.rs | 2 +- src/test/parse-fail/issue-5544-b.rs | 2 +- src/test/parse-fail/lex-bad-numeric-literals.rs | 4 ++-- 6 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 src/test/compile-fail/oversized-literal.rs diff --git a/src/test/compile-fail/const-tup-index-span.rs b/src/test/compile-fail/const-tup-index-span.rs index 8f7ec9de58a..f3fb92e2b22 100644 --- a/src/test/compile-fail/const-tup-index-span.rs +++ b/src/test/compile-fail/const-tup-index-span.rs @@ -10,7 +10,7 @@ // Test spans of errors -const TUP: (usize,) = 5 << 64; +const TUP: (usize,) = 5usize << 64; //~^ ERROR E0080 //~| attempt to shift left with overflow const ARR: [i32; TUP.0] = []; diff --git a/src/test/compile-fail/oversized-literal.rs b/src/test/compile-fail/oversized-literal.rs deleted file mode 100644 index 5416bcacf3d..00000000000 --- a/src/test/compile-fail/oversized-literal.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - println!("{}", 18446744073709551616u64); //~ error: int literal is too large -} diff --git a/src/test/parse-fail/int-literal-too-large-span.rs b/src/test/parse-fail/int-literal-too-large-span.rs index c4b25d43579..1af8df7d2f6 100644 --- a/src/test/parse-fail/int-literal-too-large-span.rs +++ b/src/test/parse-fail/int-literal-too-large-span.rs @@ -13,7 +13,7 @@ // issue #17123 fn main() { - 100000000000000000000000000000000 //~ ERROR int literal is too large - + 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + //~^ ERROR int literal is too large ; // the span shouldn't point to this. } diff --git a/src/test/parse-fail/issue-5544-a.rs b/src/test/parse-fail/issue-5544-a.rs index f406b2cc803..cf1500e34d8 100644 --- a/src/test/parse-fail/issue-5544-a.rs +++ b/src/test/parse-fail/issue-5544-a.rs @@ -11,6 +11,6 @@ // compile-flags: -Z parse-only fn main() { - let __isize = 18446744073709551616; // 2^64 + let __isize = 340282366920938463463374607431768211456; // 2^128 //~^ ERROR int literal is too large } diff --git a/src/test/parse-fail/issue-5544-b.rs b/src/test/parse-fail/issue-5544-b.rs index 898b0920645..8c0b6741cb8 100644 --- a/src/test/parse-fail/issue-5544-b.rs +++ b/src/test/parse-fail/issue-5544-b.rs @@ -11,6 +11,6 @@ // compile-flags: -Z parse-only fn main() { - let __isize = 0xff_ffff_ffff_ffff_ffff; + let __isize = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ff; //~^ ERROR int literal is too large } diff --git a/src/test/parse-fail/lex-bad-numeric-literals.rs b/src/test/parse-fail/lex-bad-numeric-literals.rs index bb97b037a00..d495a8edd09 100644 --- a/src/test/parse-fail/lex-bad-numeric-literals.rs +++ b/src/test/parse-fail/lex-bad-numeric-literals.rs @@ -23,8 +23,8 @@ fn main() { 0o; //~ ERROR: no valid digits 1e+; //~ ERROR: expected at least one digit in exponent 0x539.0; //~ ERROR: hexadecimal float literal is not supported - 99999999999999999999999999999999; //~ ERROR: int literal is too large - 99999999999999999999999999999999; //~ ERROR: int literal is too large + 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large + 9900000000000000000000000000999999999999999999999999999999; //~ ERROR: int literal is too large 0x; //~ ERROR: no valid digits 0xu32; //~ ERROR: no valid digits 0ou32; //~ ERROR: no valid digits