about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMark Mansi <markm@cs.wisc.edu>2018-04-25 16:33:02 -0500
committerMark Mansi <markm@cs.wisc.edu>2018-04-25 16:33:02 -0500
commit256096da9ee680366b839f912e8d3ecccc0da033 (patch)
treeaf468b7e26785c13cd95894035a3144500243bf4 /src/test
parent25749ad66de71ffb46e6b04fb0cccf1ae4fc5ed5 (diff)
downloadrust-256096da9ee680366b839f912e8d3ecccc0da033.tar.gz
rust-256096da9ee680366b839f912e8d3ecccc0da033.zip
Make Vec::new const
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/vec-const-new.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/run-pass/vec-const-new.rs b/src/test/run-pass/vec-const-new.rs
new file mode 100644
index 00000000000..02d8cfdcf98
--- /dev/null
+++ b/src/test/run-pass/vec-const-new.rs
@@ -0,0 +1,15 @@
+// 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 <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 that Vec::new() can be used for constants
+
+const MY_VEC: Vec<usize> = Vec::new();
+
+pub fn main() {}