Skip to content

Commit

Permalink
Merge pull request #434 from rust-lang/fix/kv-features
Browse files Browse the repository at this point in the history
check std feature against kv_unstable
  • Loading branch information
KodrAus committed Jan 8, 2021
2 parents 35dbf7d + cc3d6ed commit b169072
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/main.yml
Expand Up @@ -40,8 +40,9 @@ jobs:
- run: cargo test --verbose --features serde
- run: cargo test --verbose --features std
- run: cargo test --verbose --features kv_unstable
- run: cargo test --verbose --features "kv_unstable std"
- run: cargo test --verbose --features "kv_unstable_sval"
- run: cargo test --verbose --features kv_unstable_sval
- run: cargo test --verbose --features kv_unstable_serde
- run: cargo test --verbose --features "kv_unstable kv_unstable_std kv_unstable_sval kv_unstable_serde"
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml
- run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release

Expand All @@ -57,6 +58,22 @@ jobs:
rustup component add rustfmt
- run: cargo fmt -- --check

features:
name: Feature check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup update nightly --no-self-update
rustup default nightly
- run: cargo build --verbose -Z avoid-dev-deps --features kv_unstable
- run: cargo build --verbose -Z avoid-dev-deps --features "kv_unstable std"
- run: cargo build --verbose -Z avoid-dev-deps --features "kv_unstable kv_unstable_sval"
- run: cargo build --verbose -Z avoid-dev-deps --features "kv_unstable kv_unstable_serde"
- run: cargo build --verbose -Z avoid-dev-deps --features "kv_unstable kv_unstable_std"
- run: cargo build --verbose -Z avoid-dev-deps --features "kv_unstable kv_unstable_sval kv_unstable_serde"

msrv:
name: MSRV
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions src/kv/value.rs
Expand Up @@ -427,7 +427,7 @@ impl<'v> Value<'v> {
}
}

#[cfg(feature = "std")]
#[cfg(feature = "kv_unstable_std")]
mod std_support {
use super::*;

Expand Down Expand Up @@ -615,7 +615,7 @@ pub(crate) mod tests {
for v in str() {
assert!(v.to_borrowed_str().is_some());

#[cfg(feature = "std")]
#[cfg(feature = "kv_unstable_std")]
assert!(v.to_str().is_some());
}

Expand All @@ -624,13 +624,13 @@ pub(crate) mod tests {

assert!(v.to_borrowed_str().is_some());

#[cfg(feature = "std")]
#[cfg(feature = "kv_unstable_std")]
assert!(v.to_str().is_some());

for v in unsigned().chain(signed()).chain(float()).chain(bool()) {
assert!(v.to_borrowed_str().is_none());

#[cfg(feature = "std")]
#[cfg(feature = "kv_unstable_std")]
assert!(v.to_str().is_none());
}
}
Expand Down

0 comments on commit b169072

Please sign in to comment.