mirror of
https://github.com/servo/servo.git
synced 2025-09-19 19:30:10 +01:00
base: Remove last usage of static_assertions crate (#38687)
Replace static_assertions in the `size_of_test` macro with `const assert`s. The error message is still informative. Additionally also remove the `cfg` guard, which caused the assertion to only be enabled on 64 bit platforms, which is something one would not expect given the name `size_of_test` of the macro. `cargo tree -i static_assertions` now points to only `stylo` using `static_assertions`, so we should be able to remove this dependency fairly easy, since the macro doesn't seem to be used there either at first glance. Testing: Covered by existing tests. --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
parent
f492cbf8c1
commit
40e57e95b2
4 changed files with 1 additions and 5 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -728,7 +728,6 @@ dependencies = [
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"serde",
|
"serde",
|
||||||
"servo_malloc_size_of",
|
"servo_malloc_size_of",
|
||||||
"static_assertions",
|
|
||||||
"time",
|
"time",
|
||||||
"webrender_api",
|
"webrender_api",
|
||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
|
|
|
@ -140,7 +140,6 @@ servo-tracing = { path = "components/servo_tracing" }
|
||||||
servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
|
servo_arc = { git = "https://github.com/servo/stylo", branch = "2025-08-01" }
|
||||||
smallbitvec = "2.6.0"
|
smallbitvec = "2.6.0"
|
||||||
smallvec = { version = "1.15", features = ["serde", "union"] }
|
smallvec = { version = "1.15", features = ["serde", "union"] }
|
||||||
static_assertions = "1.1"
|
|
||||||
string_cache = "0.8"
|
string_cache = "0.8"
|
||||||
string_cache_codegen = "0.5"
|
string_cache_codegen = "0.5"
|
||||||
strum = "0.26"
|
strum = "0.26"
|
||||||
|
|
|
@ -20,7 +20,6 @@ malloc_size_of = { workspace = true }
|
||||||
malloc_size_of_derive = { workspace = true }
|
malloc_size_of_derive = { workspace = true }
|
||||||
parking_lot = { workspace = true }
|
parking_lot = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
static_assertions = { workspace = true }
|
|
||||||
time = { workspace = true }
|
time = { workspace = true }
|
||||||
webrender_api = { workspace = true }
|
webrender_api = { workspace = true }
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,7 @@ use webrender_api::{ExternalScrollId, PipelineId as WebRenderPipelineId};
|
||||||
/// Asserts the size of a type at compile time.
|
/// Asserts the size of a type at compile time.
|
||||||
macro_rules! size_of_test {
|
macro_rules! size_of_test {
|
||||||
($t: ty, $expected_size: expr) => {
|
($t: ty, $expected_size: expr) => {
|
||||||
#[cfg(target_pointer_width = "64")]
|
const _: () = assert!(std::mem::size_of::<$t>() == $expected_size);
|
||||||
::static_assertions::const_assert_eq!(std::mem::size_of::<$t>(), $expected_size);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue