Skip to content

Commit 975dab2

Browse files
spirv: Allow crate to remain no_std when (de)serialize features are enabled (#254)
When the `spirv` crate was made `no_std` in #177, it disregarded the optional `serde` crate which isn't (at least at the point of writing) `no_std`-compliant unless its default features are disabled: disable those so that a build with these optional `(de)serialize` features remains `no_std` compatible. --------- Co-authored-by: Marijn Suijten <[email protected]>
1 parent 267882d commit 975dab2

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions-rs/cargo@v1
4949
with:
5050
command: clippy
51-
args: --all --all-targets -- -Dwarnings
51+
args: --workspace --all-features --all-targets -- -Dwarnings
5252
test:
5353
name: Cargo check and test
5454
strategy:
@@ -67,8 +67,8 @@ jobs:
6767
- uses: actions-rs/cargo@v1
6868
with:
6969
command: check
70-
args: --workspace --all-targets --verbose
70+
args: --workspace --all-features --all-targets --verbose
7171
- uses: actions-rs/cargo@v1
7272
with:
7373
command: test
74-
args: --workspace --verbose
74+
args: --workspace --all-features --verbose

rspirv/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ path = "lib.rs"
1818
travis-ci = { repository = "gfx-rs/rspirv" }
1919

2020
[dependencies]
21-
clippy = { version = "0.0", optional = true }
2221
rustc-hash = "1.1.0"
2322
spirv = { version = "0.3.0", path = "../spirv" }
2423

rspirv/binary/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const WORD_NUM_BYTES: usize = 4;
3535
///
3636
/// * `DecodeError::LimitReached(offset)` if the most recent limit has reached.
3737
/// * `DecodeError::StreamExpected(offset)` if more bytes are needed to decode
38-
/// the next word.
38+
/// the next word.
3939
/// * `DecodeError::<spirv-enum>Unknown(offset, value)` if failed to decode the
40-
/// next word as the given `<spirv-enum>`.
40+
/// next word as the given `<spirv-enum>`.
4141
///
4242
/// All errors contain the byte offset of the word failed decoding.
4343
///

rspirv/sr/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Constant {
5050
}
5151

5252
pub fn is_null_constant(&self) -> bool {
53-
matches!(self, Constant::Null { .. })
53+
matches!(self, Constant::Null)
5454
}
5555

5656
pub fn is_sampler_constant(&self) -> bool {

spirv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ path = "lib.rs"
2020

2121
[dependencies]
2222
bitflags = "2.0"
23-
serde = { version = "1", optional = true, features = ["derive"] }
23+
serde = { version = "1", optional = true, default-features = false, features = ["derive"] }

spirv/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
#![no_std]
99
#![allow(non_camel_case_types)]
10+
#![deny(clippy::std_instead_of_core, clippy::alloc_instead_of_core)]
1011
#![cfg_attr(rustfmt, rustfmt_skip)]
1112

1213
use bitflags::bitflags;

0 commit comments

Comments
 (0)