Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 908b168

Browse files
authored
Merge pull request #130 from TheBlueMatt/master
Fix alloc + std builds (and test)
2 parents 5072646 + ab90b00 commit 908b168

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ jobs:
7979
env:
8080
DO_FEATURE_MATRIX: true
8181
DO_SCHEMARS_TESTS: ${{matrix.rust != '1.29.0'}}
82+
DO_ALLOC_TESTS: ${{matrix.rust != '1.29.0'}}
8283
run: ./contrib/test.sh
8384

8485
Embedded:

contrib/test.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/sh -ex
22

3-
FEATURES="serde serde-std"
3+
FEATURES="serde serde-std std"
4+
5+
if [ "$DO_ALLOC_TESTS" = true ]; then
6+
FEATURES="$FEATURES alloc"
7+
fi
48

59
# Use toolchain if explicitly specified
610
if [ -n "$TOOLCHAIN" ]
@@ -30,6 +34,11 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
3034
do
3135
cargo build --all --no-default-features --features="$feature"
3236
cargo test --all --features="$feature"
37+
# All combos of two features
38+
for featuretwo in ${FEATURES}; do
39+
cargo build --all --no-default-features --features="$feature $featuretwo"
40+
cargo test --all --features="$feature $featuretwo"
41+
done
3342
done
3443

3544
# Other combos

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939

4040
#[cfg(any(test, feature="std"))] extern crate core;
4141
#[cfg(feature="core2")] extern crate core2;
42-
#[cfg(any(feature = "alloc"))] extern crate alloc;
43-
#[cfg(any(feature = "std"))] use std as alloc;
42+
#[cfg(feature = "alloc")] extern crate alloc;
43+
#[cfg(all(not(feature = "alloc"), feature = "std"))] use std as alloc;
4444
#[cfg(feature="serde")] pub extern crate serde;
4545
#[cfg(all(test,feature="serde"))] extern crate serde_test;
4646

0 commit comments

Comments
 (0)