about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-12-18 13:43:45 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-12-18 15:56:39 +0530
commitcb319fc84fa52773dd31ead8761b1c251e916e88 (patch)
treec52b297a99841a17ebba324e405cb32268853290 /src/test
parentf963eb2870f6e2b972cd9d432dc0ece954ab6452 (diff)
parent88675939d25a22d9e636d98bb045ea7e4f6e5955 (diff)
Rollup merge of #30286 - oli-obk:const_error_span, r=nikomatsakis
previously the error was erased and a `non-const path` error was emitted at the location of the field access instead of at the overflow location (as can be seen in the playground: http://is.gd/EuAF5F )
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/const-tup-index-span.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/compile-fail/const-tup-index-span.rs b/src/test/compile-fail/const-tup-index-span.rs
new file mode 100644
index 00000000000..8c607fc7e32
--- /dev/null
+++ b/src/test/compile-fail/const-tup-index-span.rs
@@ -0,0 +1,18 @@
+// Copyright 2015 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test spans of errors
+
+const TUP: (usize,) = 5 << 64;
+//~^ ERROR: attempted left shift with overflow [E0250]
+const ARR: [i32; TUP.0] = [];
+
+fn main() {
+}