diff options
| author | Mark Mansi <markm@cs.wisc.edu> | 2018-04-25 16:33:02 -0500 |
|---|---|---|
| committer | Mark Mansi <markm@cs.wisc.edu> | 2018-04-25 16:33:02 -0500 |
| commit | 256096da9ee680366b839f912e8d3ecccc0da033 (patch) | |
| tree | af468b7e26785c13cd95894035a3144500243bf4 /src/test | |
| parent | 25749ad66de71ffb46e6b04fb0cccf1ae4fc5ed5 (diff) | |
| download | rust-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.rs | 15 |
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() {} |
