about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-03 19:52:11 +0000
committerbors <bors@rust-lang.org>2016-03-03 19:52:11 +0000
commit809b14acf10fa717716c054a3d1dd4d400784d19 (patch)
treee6adc7846e4a9f806391d3c7ce50066712938f75
parent493d999ffa44be6610441dabab80e18dda90015a (diff)
parent34aed8f06237a5f53961de1e4bfc590d63deaa19 (diff)
downloadrust-809b14acf10fa717716c054a3d1dd4d400784d19.tar.gz
rust-809b14acf10fa717716c054a3d1dd4d400784d19.zip
Auto merge of #31797 - apasel422:issue-28950, r=alexcrichton
Closes #28950.

r? @eddyb
-rw-r--r--src/libcollections/lib.rs1
-rw-r--r--src/libcollections/macros.rs5
-rw-r--r--src/test/run-pass/borrow-by-val-method-receiver.rs3
-rw-r--r--src/test/run-pass/borrowck/borrowck-binding-mutbl.rs3
-rw-r--r--src/test/run-pass/generic-ivec-leak.rs2
-rw-r--r--src/test/run-pass/issue-17816.rs2
-rw-r--r--src/test/run-pass/issue-18514.rs1
-rw-r--r--src/test/run-pass/issue-2631-b.rs2
-rw-r--r--src/test/run-pass/issue-2723-b.rs2
-rw-r--r--src/test/run-pass/issue-28950.rs23
-rw-r--r--src/test/run-pass/ivec-pass-by-value.rs3
-rw-r--r--src/test/run-pass/ivec-tag.rs1
-rw-r--r--src/test/run-pass/macro-delimiter-significance.rs2
-rw-r--r--src/test/run-pass/regions-dependent-autoslice.rs3
-rw-r--r--src/test/run-pass/vec-push.rs2
15 files changed, 27 insertions, 28 deletions
diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs
index 373fe7dc4c1..e6cf5aa6683 100644
--- a/src/libcollections/lib.rs
+++ b/src/libcollections/lib.rs
@@ -31,6 +31,7 @@
 #![cfg_attr(not(stage0), deny(warnings))]
 
 #![feature(alloc)]
+#![feature(allow_internal_unstable)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(core_intrinsics)]
diff --git a/src/libcollections/macros.rs b/src/libcollections/macros.rs
index 6a683e65c9e..d6a8362d581 100644
--- a/src/libcollections/macros.rs
+++ b/src/libcollections/macros.rs
@@ -41,12 +41,13 @@
 #[cfg(not(test))]
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[allow_internal_unstable]
 macro_rules! vec {
     ($elem:expr; $n:expr) => (
         $crate::vec::from_elem($elem, $n)
     );
     ($($x:expr),*) => (
-        <[_]>::into_vec($crate::boxed::Box::new([$($x),*]))
+        <[_]>::into_vec(box [$($x),*])
     );
     ($($x:expr,)*) => (vec![$($x),*])
 }
@@ -61,7 +62,7 @@ macro_rules! vec {
         $crate::vec::from_elem($elem, $n)
     );
     ($($x:expr),*) => (
-        $crate::slice::into_vec($crate::boxed::Box::new([$($x),*]))
+        $crate::slice::into_vec(box [$($x),*])
     );
     ($($x:expr,)*) => (vec![$($x),*])
 }
diff --git a/src/test/run-pass/borrow-by-val-method-receiver.rs b/src/test/run-pass/borrow-by-val-method-receiver.rs
index 7efda12192a..052b6053931 100644
--- a/src/test/run-pass/borrow-by-val-method-receiver.rs
+++ b/src/test/run-pass/borrow-by-val-method-receiver.rs
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-// pretty-expanded FIXME #23616
-
 trait Foo {
     fn foo(self);
 }
diff --git a/src/test/run-pass/borrowck/borrowck-binding-mutbl.rs b/src/test/run-pass/borrowck/borrowck-binding-mutbl.rs
index 10e9a1b51e2..187063968f7 100644
--- a/src/test/run-pass/borrowck/borrowck-binding-mutbl.rs
+++ b/src/test/run-pass/borrowck/borrowck-binding-mutbl.rs
@@ -8,9 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-// pretty-expanded FIXME #23616
-
 struct F { f: Vec<isize> }
 
 fn impure(_v: &[isize]) {
diff --git a/src/test/run-pass/generic-ivec-leak.rs b/src/test/run-pass/generic-ivec-leak.rs
index b14a6101225..eb0546063f7 100644
--- a/src/test/run-pass/generic-ivec-leak.rs
+++ b/src/test/run-pass/generic-ivec-leak.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// pretty-expanded FIXME #23616
-
 enum wrapper<T> { wrapped(T), }
 
 pub fn main() { let _w = wrapper::wrapped(vec!(1, 2, 3, 4, 5)); }
diff --git a/src/test/run-pass/issue-17816.rs b/src/test/run-pass/issue-17816.rs
index 65a0b51095c..8e3cb414566 100644
--- a/src/test/run-pass/issue-17816.rs
+++ b/src/test/run-pass/issue-17816.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// pretty-expanded FIXME #23616
-
 #![feature(unboxed_closures)]
 
 use std::marker::PhantomData;
diff --git a/src/test/run-pass/issue-18514.rs b/src/test/run-pass/issue-18514.rs
index b0b2f068bb7..88bf95f036b 100644
--- a/src/test/run-pass/issue-18514.rs
+++ b/src/test/run-pass/issue-18514.rs
@@ -15,7 +15,6 @@
 // impl.
 
 // aux-build:issue-18514.rs
-// pretty-expanded FIXME #23616
 
 extern crate issue_18514 as ice;
 use ice::{Tr, St};
diff --git a/src/test/run-pass/issue-2631-b.rs b/src/test/run-pass/issue-2631-b.rs
index 7413ebd3504..365b594c99e 100644
--- a/src/test/run-pass/issue-2631-b.rs
+++ b/src/test/run-pass/issue-2631-b.rs
@@ -11,8 +11,6 @@
 
 // aux-build:issue-2631-a.rs
 
-// pretty-expanded FIXME #23616
-
 extern crate req;
 
 use req::request;
diff --git a/src/test/run-pass/issue-2723-b.rs b/src/test/run-pass/issue-2723-b.rs
index 7fee2fc16cb..bab7b0d24db 100644
--- a/src/test/run-pass/issue-2723-b.rs
+++ b/src/test/run-pass/issue-2723-b.rs
@@ -10,8 +10,6 @@
 
 // aux-build:issue_2723_a.rs
 
-// pretty-expanded FIXME #23616
-
 extern crate issue_2723_a;
 use issue_2723_a::f;
 
diff --git a/src/test/run-pass/issue-28950.rs b/src/test/run-pass/issue-28950.rs
new file mode 100644
index 00000000000..f01ce46a891
--- /dev/null
+++ b/src/test/run-pass/issue-28950.rs
@@ -0,0 +1,23 @@
+// Copyright 2012-2016 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.
+
+// Tests that the `vec!` macro does not overflow the stack when it is
+// given data larger than the stack.
+
+const LEN: usize = 1 << 15;
+
+use std::thread::Builder;
+
+fn main() {
+    assert!(Builder::new().stack_size(LEN / 2).spawn(|| {
+        let vec = vec![[0; LEN]];
+        assert_eq!(vec.len(), 1);
+    }).unwrap().join().is_ok());
+}
diff --git a/src/test/run-pass/ivec-pass-by-value.rs b/src/test/run-pass/ivec-pass-by-value.rs
index 62aa3005783..5b40105a979 100644
--- a/src/test/run-pass/ivec-pass-by-value.rs
+++ b/src/test/run-pass/ivec-pass-by-value.rs
@@ -8,8 +8,5 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-// pretty-expanded FIXME #23616
-
 fn f(_a: Vec<isize> ) { }
 pub fn main() { f(vec!(1, 2, 3, 4, 5)); }
diff --git a/src/test/run-pass/ivec-tag.rs b/src/test/run-pass/ivec-tag.rs
index e7498f7c174..b8238774bc1 100644
--- a/src/test/run-pass/ivec-tag.rs
+++ b/src/test/run-pass/ivec-tag.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// pretty-expanded FIXME #23616
 // ignore-emscripten no threads support
 
 #![feature(std_misc)]
diff --git a/src/test/run-pass/macro-delimiter-significance.rs b/src/test/run-pass/macro-delimiter-significance.rs
index 6a3a495f2f1..a2ae3fbf83b 100644
--- a/src/test/run-pass/macro-delimiter-significance.rs
+++ b/src/test/run-pass/macro-delimiter-significance.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// pretty-expanded FIXME #23616
-
 fn main() {
     vec![1_usize, 2, 3].len();
 }
diff --git a/src/test/run-pass/regions-dependent-autoslice.rs b/src/test/run-pass/regions-dependent-autoslice.rs
index fd0d8121f5f..7183937fe80 100644
--- a/src/test/run-pass/regions-dependent-autoslice.rs
+++ b/src/test/run-pass/regions-dependent-autoslice.rs
@@ -11,9 +11,6 @@
 // Test lifetimes are linked properly when we autoslice a vector.
 // Issue #3148.
 
-
-// pretty-expanded FIXME #23616
-
 fn subslice1<'r>(v: &'r [usize]) -> &'r [usize] { v }
 
 fn both<'r>(v: &'r [usize]) -> &'r [usize] {
diff --git a/src/test/run-pass/vec-push.rs b/src/test/run-pass/vec-push.rs
index b69bd53cb8c..33f01c5bd41 100644
--- a/src/test/run-pass/vec-push.rs
+++ b/src/test/run-pass/vec-push.rs
@@ -8,6 +8,4 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// pretty-expanded FIXME #23616
-
 pub fn main() { let mut v = vec!(1, 2, 3); v.push(1); }