commit 97e517cfa172b2f8dd9e987c1089fd82f39aad7a parent fef70663ddbb6a4d20fd9ce56b4cd1a84af09194 Author: Nico Burns <nico@nicoburns.com> Date: Mon, 15 Dec 2025 19:03:57 +0000 Bug 2005254: Remove extern crate for various dependencies of the style crate (r=firefox-style-system-reviewers,dshin) Differential Revision: https://phabricator.services.mozilla.com/D275842 Diffstat:
7 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/servo/components/style/gecko/pseudo_element.rs b/servo/components/style/gecko/pseudo_element.rs @@ -57,7 +57,7 @@ pub struct PtNameAndClassSelector(thin_vec::ThinVec<Atom>); impl PtNameAndClassSelector { /// Constructs a new one from a name. pub fn from_name(name: Atom) -> Self { - Self(thin_vec![name]) + Self(thin_vec::thin_vec![name]) } /// Returns the name component. @@ -142,7 +142,7 @@ impl PtNameAndClassSelector { // Use the universal symbol as the first element to present the part of // `<pt-name-selector>` because they are equivalent (and the serialization is the same). - let mut result = thin_vec![name.unwrap_or(atom!("*"))]; + let mut result = thin_vec::thin_vec![name.unwrap_or(atom!("*"))]; result.append(&mut classes); Ok(Self(result)) diff --git a/servo/components/style/gecko_string_cache/mod.rs b/servo/components/style/gecko_string_cache/mod.rs @@ -528,6 +528,6 @@ impl From<String> for Atom { } } -malloc_size_of_is_0!(Atom); +malloc_size_of::malloc_size_of_is_0!(Atom); impl SpecifiedValueInfo for Atom {} diff --git a/servo/components/style/global_style_data.rs b/servo/components/style/global_style_data.rs @@ -191,7 +191,6 @@ lazy_static! { if num_threads >= 0 { num_threads as usize } else { - use num_cpus; // The default heuristic is num_virtual_cores * .75. This gives us three threads on a // hyper-threaded dual core, and six threads on a hyper-threaded quad core. cmp::max(num_cpus::get() * 3 / 4, 1) diff --git a/servo/components/style/invalidation/element/restyle_hints.rs b/servo/components/style/invalidation/element/restyle_hints.rs @@ -192,4 +192,4 @@ impl Default for RestyleHint { } #[cfg(feature = "servo")] -malloc_size_of_is_0!(RestyleHint); +malloc_size_of::malloc_size_of_is_0!(RestyleHint); diff --git a/servo/components/style/lib.rs b/servo/components/style/lib.rs @@ -39,18 +39,9 @@ pub mod gecko_string_cache; extern crate lazy_static; #[macro_use] extern crate log; -#[macro_use] -extern crate malloc_size_of; -#[cfg(feature = "servo")] -extern crate web_atoms; #[allow(unused_extern_crates)] #[macro_use] extern crate matches; -#[cfg(feature = "gecko")] -pub use nsstring; -#[cfg(feature = "gecko")] -extern crate num_cpus; -#[macro_use] extern crate serde; pub use servo_arc; #[cfg(feature = "servo")] @@ -58,9 +49,6 @@ pub use servo_arc; extern crate stylo_atoms; #[macro_use] extern crate static_assertions; -#[cfg(feature = "gecko")] -#[macro_use] -extern crate thin_vec; #[macro_use] mod macros; diff --git a/servo/components/style/rule_tree/core.rs b/servo/components/style/rule_tree/core.rs @@ -518,7 +518,7 @@ pub struct StrongRuleNode { } #[cfg(feature = "servo")] -malloc_size_of_is_0!(StrongRuleNode); +malloc_size_of::malloc_size_of_is_0!(StrongRuleNode); impl StrongRuleNode { fn new(n: Box<RuleNode>) -> Self { diff --git a/servo/components/style/servo/restyle_damage.rs b/servo/components/style/servo/restyle_damage.rs @@ -50,7 +50,7 @@ bitflags! { } } -malloc_size_of_is_0!(ServoRestyleDamage); +malloc_size_of::malloc_size_of_is_0!(ServoRestyleDamage); impl ServoRestyleDamage { /// Compute the `StyleDifference` (including the appropriate restyle damage)