diff --git a/Cargo.lock b/Cargo.lock index 72b612dbdecd7..9a3e3cdb587f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -863,7 +863,6 @@ dependencies = [ "serde", "serde_json", "sha2", - "static_assertions", "thiserror", "url", ] @@ -3452,12 +3451,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index 3e2e2ea16b8a4..95100d360134f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,6 @@ seahash = { version = "4.1.0" } serde = { version = "1.0.194" } serde_json = { version = "1.0.111" } sha2 = { version = "0.10.8" } -static_assertions = { version = "1.1.0" } tar = { version = "0.4.40" } target-lexicon = { version = "0.12.13" } tempfile = { version = "3.9.0" } diff --git a/crates/distribution-types/Cargo.toml b/crates/distribution-types/Cargo.toml index bc89cbd66ca4f..4b87d2665d82e 100644 --- a/crates/distribution-types/Cargo.toml +++ b/crates/distribution-types/Cargo.toml @@ -32,6 +32,5 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } sha2 = { workspace = true } -static_assertions = { workspace = true } thiserror = { workspace = true } url = { workspace = true } diff --git a/crates/distribution-types/src/lib.rs b/crates/distribution-types/src/lib.rs index 0abf7f19e42f2..aa2e85337252f 100644 --- a/crates/distribution-types/src/lib.rs +++ b/crates/distribution-types/src/lib.rs @@ -37,7 +37,6 @@ use std::path::{Path, PathBuf}; use std::str::FromStr; use anyhow::Result; -use static_assertions::assert_eq_size; use url::Url; use distribution_filename::{DistFilename, SourceDistFilename, WheelFilename}; @@ -202,10 +201,6 @@ pub struct PathSourceDist { pub editable: bool, } -assert_eq_size!(Dist, [u8; 240]); -assert_eq_size!(BuiltDist, [u8; 240]); -assert_eq_size!(SourceDist, [u8; 168]); - impl Dist { /// Create a [`Dist`] for a registry-based distribution. pub fn from_registry(filename: DistFilename, file: File, index: IndexUrl) -> Self { @@ -870,3 +865,16 @@ impl Identifier for Dist { } } } + +#[cfg(test)] +mod test { + use crate::{BuiltDist, Dist, SourceDist}; + + /// Ensure that we don't accidentally grow the `Dist` sizes. + #[test] + fn dist_size() { + assert!(std::mem::size_of::() <= 240); + assert!(std::mem::size_of::() <= 240); + assert!(std::mem::size_of::() <= 168); + } +}