summaryrefslogtreecommitdiffstats
path: root/src/test/ui/array-slice-vec/vec-late-init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/array-slice-vec/vec-late-init.rs')
-rw-r--r--src/test/ui/array-slice-vec/vec-late-init.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/array-slice-vec/vec-late-init.rs b/src/test/ui/array-slice-vec/vec-late-init.rs
new file mode 100644
index 000000000..5dee36082
--- /dev/null
+++ b/src/test/ui/array-slice-vec/vec-late-init.rs
@@ -0,0 +1,9 @@
+// run-pass
+#![allow(unused_mut)]
+
+
+pub fn main() {
+ let mut later: Vec<isize> ;
+ if true { later = vec![1]; } else { later = vec![2]; }
+ println!("{}", later[0]);
+}