Skip to content

Commit b08b5ae

Browse files
committed
try_reserve: disabling tests for asmjs, blocked by #48968
1 parent 92bfcd2 commit b08b5ae

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

src/liballoc/tests/string.rs

+5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
// except according to those terms.
1010

1111
use std::borrow::Cow;
12+
#[cfg(not(target_arch = "asmjs"))]
1213
use std::collections::CollectionAllocErr::*;
14+
#[cfg(not(target_arch = "asmjs"))]
1315
use std::mem::size_of;
16+
#[cfg(not(target_arch = "asmjs"))]
1417
use std::{usize, isize};
1518

1619
pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
@@ -532,6 +535,7 @@ fn test_reserve_exact() {
532535
assert!(s.capacity() >= 33)
533536
}
534537

538+
#[cfg(not(target_arch = "asmjs"))]
535539
#[test]
536540
fn test_try_reserve() {
537541

@@ -609,6 +613,7 @@ fn test_try_reserve() {
609613

610614
}
611615

616+
#[cfg(not(target_arch = "asmjs"))]
612617
#[test]
613618
fn test_try_reserve_exact() {
614619

src/liballoc/tests/vec.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010

1111
use std::borrow::Cow;
1212
use std::mem::size_of;
13-
use std::{usize, isize, panic};
13+
use std::{usize, panic};
14+
#[cfg(not(target_arch = "asmjs"))]
15+
use std::isize;
1416
use std::vec::{Drain, IntoIter};
17+
#[cfg(not(target_arch = "asmjs"))]
1518
use std::collections::CollectionAllocErr::*;
1619

1720
struct DropCounter<'a> {
@@ -991,6 +994,7 @@ fn test_reserve_exact() {
991994
assert!(v.capacity() >= 33)
992995
}
993996

997+
#[cfg(not(target_arch = "asmjs"))]
994998
#[test]
995999
fn test_try_reserve() {
9961000

@@ -1093,6 +1097,7 @@ fn test_try_reserve() {
10931097

10941098
}
10951099

1100+
#[cfg(not(target_arch = "asmjs"))]
10961101
#[test]
10971102
fn test_try_reserve_exact() {
10981103

src/liballoc/tests/vec_deque.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
use std::collections::VecDeque;
1212
use std::fmt::Debug;
1313
use std::collections::vec_deque::{Drain};
14+
#[cfg(not(target_arch = "asmjs"))]
1415
use std::collections::CollectionAllocErr::*;
16+
#[cfg(not(target_arch = "asmjs"))]
1517
use std::mem::size_of;
16-
use std::{usize, isize};
18+
use std::isize;
19+
#[cfg(not(target_arch = "asmjs"))]
20+
use std::usize;
1721

1822
use self::Taggy::*;
1923
use self::Taggypar::*;
@@ -1049,6 +1053,7 @@ fn test_reserve_exact_2() {
10491053
assert!(v.capacity() >= 48)
10501054
}
10511055

1056+
#[cfg(not(target_arch = "asmjs"))]
10521057
#[test]
10531058
fn test_try_reserve() {
10541059

@@ -1150,6 +1155,7 @@ fn test_try_reserve() {
11501155

11511156
}
11521157

1158+
#[cfg(not(target_arch = "asmjs"))]
11531159
#[test]
11541160
fn test_try_reserve_exact() {
11551161

src/libstd/collections/hash/map.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2755,8 +2755,11 @@ mod test_map {
27552755
use cell::RefCell;
27562756
use rand::{thread_rng, Rng};
27572757
use panic;
2758+
#[cfg(not(target_arch = "asmjs"))]
27582759
use realstd::collections::CollectionAllocErr::*;
2760+
#[cfg(not(target_arch = "asmjs"))]
27592761
use realstd::mem::size_of;
2762+
#[cfg(not(target_arch = "asmjs"))]
27602763
use realstd::usize;
27612764

27622765
#[test]
@@ -3693,6 +3696,7 @@ mod test_map {
36933696
assert_eq!(hm.len(), 0);
36943697
}
36953698

3699+
#[cfg(not(target_arch = "asmjs"))]
36963700
#[test]
36973701
fn test_try_reserve() {
36983702

0 commit comments

Comments
 (0)