From a2ed09a006b5ae3cb671feb52e6ee2ea0e4f0a3a Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Mon, 12 Aug 2013 21:15:19 -0400 Subject: Add test for repeat expr in statics. --- src/test/compile-fail/static-vec-repeat-not-constant.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/compile-fail/static-vec-repeat-not-constant.rs (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/static-vec-repeat-not-constant.rs b/src/test/compile-fail/static-vec-repeat-not-constant.rs new file mode 100644 index 00000000000..7721e18537e --- /dev/null +++ b/src/test/compile-fail/static-vec-repeat-not-constant.rs @@ -0,0 +1,15 @@ +// Copyright 2013 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 foo() -> int { 23 } + +static a: [int, ..2] = [foo(), ..2]; //~ ERROR: function calls in constants are limited to struct and enum constructors + +fn main() {} -- cgit 1.4.1-3-g733a5