]> git.lizzy.rs Git - rust.git/commitdiff
setting ABORTING_MALLOC for asmjs backend
authorsnf <snf@noreply.github.com>
Wed, 14 Mar 2018 14:56:37 +0000 (14:56 +0000)
committersnf <snf@noreply.github.com>
Thu, 15 Mar 2018 17:43:05 +0000 (17:43 +0000)
src/liballoc/tests/string.rs
src/liballoc/tests/vec.rs
src/liballoc/tests/vec_deque.rs
src/librustc_back/target/asmjs_unknown_emscripten.rs
src/libstd/collections/hash/map.rs

index 9bbba4e22b03dc0d62d65defc2c487d4fe4955e3..d1e746ea43b45516875e87f7d30f94f0e194556d 100644 (file)
@@ -9,11 +9,8 @@
 // except according to those terms.
 
 use std::borrow::Cow;
-#[cfg(not(target_arch = "asmjs"))]
 use std::collections::CollectionAllocErr::*;
-#[cfg(not(target_arch = "asmjs"))]
 use std::mem::size_of;
-#[cfg(not(target_arch = "asmjs"))]
 use std::{usize, isize};
 
 pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
@@ -535,7 +532,6 @@ fn test_reserve_exact() {
     assert!(s.capacity() >= 33)
 }
 
-#[cfg(not(target_arch = "asmjs"))]
 #[test]
 fn test_try_reserve() {
 
@@ -613,7 +609,6 @@ fn test_try_reserve() {
 
 }
 
-#[cfg(not(target_arch = "asmjs"))]
 #[test]
 fn test_try_reserve_exact() {
 
index 85e11d8b8ee6ec4e68b071cf127535bbb4c00a93..3c17a401bbaf5793b4d63486d8ad3121b879c0a5 100644 (file)
 
 use std::borrow::Cow;
 use std::mem::size_of;
-use std::{usize, panic};
-#[cfg(not(target_arch = "asmjs"))]
-use std::isize;
+use std::{usize, isize, panic};
 use std::vec::{Drain, IntoIter};
-#[cfg(not(target_arch = "asmjs"))]
 use std::collections::CollectionAllocErr::*;
 
 struct DropCounter<'a> {
@@ -994,7 +991,6 @@ fn test_reserve_exact() {
     assert!(v.capacity() >= 33)
 }
 
-#[cfg(not(target_arch = "asmjs"))]
 #[test]
 fn test_try_reserve() {
 
@@ -1097,7 +1093,6 @@ fn test_try_reserve() {
 
 }
 
-#[cfg(not(target_arch = "asmjs"))]
 #[test]
 fn test_try_reserve_exact() {
 
index 9fd38ed6f6f49a8d04a0d5c6541c4c0fe661291c..fc1a0b624a555eebde59edf875a7f459074800bc 100644 (file)
 use std::collections::VecDeque;
 use std::fmt::Debug;
 use std::collections::vec_deque::{Drain};
-#[cfg(not(target_arch = "asmjs"))]
 use std::collections::CollectionAllocErr::*;
-#[cfg(not(target_arch = "asmjs"))]
 use std::mem::size_of;
-use std::isize;
-#[cfg(not(target_arch = "asmjs"))]
-use std::usize;
+use std::{usize, isize};
 
 use self::Taggy::*;
 use self::Taggypar::*;
@@ -1053,7 +1049,6 @@ fn test_reserve_exact_2() {
     assert!(v.capacity() >= 48)
 }
 
-#[cfg(not(target_arch = "asmjs"))]
 #[test]
 fn test_try_reserve() {
 
@@ -1155,7 +1150,6 @@ fn test_try_reserve() {
 
 }
 
-#[cfg(not(target_arch = "asmjs"))]
 #[test]
 fn test_try_reserve_exact() {
 
index f114926740a5ec5cd7e37bffa1d06b893c8dabd3..ab7df4ba1c543395b28c6b857c4a657997375685 100644 (file)
@@ -15,7 +15,9 @@ pub fn target() -> Result<Target, String> {
     let mut args = LinkArgs::new();
     args.insert(LinkerFlavor::Em,
                 vec!["-s".to_string(),
-                     "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string()]);
+                     "ERROR_ON_UNDEFINED_SYMBOLS=1".to_string(),
+                     "-s".to_string(),
+                     "ABORTING_MALLOC=0".to_string()]);
 
     let opts = TargetOptions {
         dynamic_linking: false,
index 5f5dec2dd4ff13a4f4f16e92cf1368eab802a2c1..b18b38ec302460e4eb1f0fd9c84739dfac9252a3 100644 (file)
@@ -2755,11 +2755,8 @@ mod test_map {
     use cell::RefCell;
     use rand::{thread_rng, Rng};
     use panic;
-    #[cfg(not(target_arch = "asmjs"))]
     use realstd::collections::CollectionAllocErr::*;
-    #[cfg(not(target_arch = "asmjs"))]
     use realstd::mem::size_of;
-    #[cfg(not(target_arch = "asmjs"))]
     use realstd::usize;
 
     #[test]
@@ -3696,7 +3693,6 @@ fn makepanic<'a>() -> TestV<'a> { panic!() }
         assert_eq!(hm.len(), 0);
     }
 
-    #[cfg(not(target_arch = "asmjs"))]
     #[test]
     fn test_try_reserve() {