1+ #[ cfg( feature = "alloc" ) ]
2+ use alloc:: { rc:: Rc , string:: String , sync:: Arc , vec:: Vec } ;
13use {
24 super :: { Arbitrary , Result , Unstructured } ,
3- alloc:: { rc:: Rc , sync:: Arc } ,
45 core:: { fmt:: Debug , hash:: Hash } ,
56 std:: collections:: HashSet ,
67} ;
@@ -156,6 +157,7 @@ fn arbitrary_take_rest_for_bytes() {
156157}
157158
158159#[ test]
160+ #[ cfg( feature = "alloc" ) ]
159161fn arbitrary_for_vec_u8 ( ) {
160162 assert_generates :: < Vec < u8 > > ( [
161163 vec ! [ ] ,
@@ -177,6 +179,7 @@ fn arbitrary_for_vec_u8() {
177179}
178180
179181#[ test]
182+ #[ cfg( feature = "alloc" ) ]
180183fn arbitrary_for_vec_vec_u8 ( ) {
181184 assert_generates :: < Vec < Vec < u8 > > > ( [
182185 vec ! [ ] ,
@@ -195,6 +198,7 @@ fn arbitrary_for_vec_vec_u8() {
195198}
196199
197200#[ test]
201+ #[ cfg( feature = "alloc" ) ]
198202fn arbitrary_for_vec_vec_vec_u8 ( ) {
199203 assert_generates :: < Vec < Vec < Vec < u8 > > > > ( [
200204 vec ! [ ] ,
@@ -219,11 +223,13 @@ fn arbitrary_for_vec_vec_vec_u8() {
219223}
220224
221225#[ test]
226+ #[ cfg( feature = "alloc" ) ]
222227fn arbitrary_for_string ( ) {
223228 assert_generates :: < String > ( [ "" . into ( ) , "a" . into ( ) , "aa" . into ( ) , "aaa" . into ( ) ] ) ;
224229}
225230
226231#[ test]
232+ #[ cfg( feature = "alloc" ) ]
227233fn arbitrary_collection ( ) {
228234 let x = [
229235 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 8 , 12 ,
@@ -259,6 +265,7 @@ fn arbitrary_collection() {
259265}
260266
261267#[ test]
268+ #[ cfg( feature = "alloc" ) ]
262269fn arbitrary_take_rest ( ) {
263270 // Basic examples
264271 let x = [ 1 , 2 , 3 , 4 ] ;
@@ -309,6 +316,7 @@ fn arbitrary_take_rest() {
309316}
310317
311318#[ test]
319+ #[ cfg( feature = "alloc" ) ]
312320fn size_hint_for_tuples ( ) {
313321 assert_eq ! (
314322 ( 7 , Some ( 7 ) ) ,
0 commit comments