Bug 1953074 Upgrade style_traits crate to edition 2021 (r=emilio)

Signed-off-by: Nico Burns <nico@nicoburns.com>

Differential Revision: https://phabricator.services.mozilla.com/D240976
This commit is contained in:
Nico Burns
2025-03-15 09:26:57 +00:00
parent 0a01922c87
commit e554ca2f0b
4 changed files with 7 additions and 25 deletions

View File

@@ -4,6 +4,7 @@ version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
repository = "https://github.com/servo/stylo"
edition = "2021"
publish = false
[lib]
@@ -19,7 +20,6 @@ app_units = "0.7"
bitflags = "2"
cssparser = "0.34"
euclid = "0.22"
lazy_static = "1"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../../../xpcom/rust/malloc_size_of_derive" }
nsstring = {path = "../../../xpcom/rust/nsstring/", optional = true}

View File

@@ -9,6 +9,7 @@ use serde::ser::{Serialize, Serializer};
use servo_arc::ThinArc;
use std::ops::Deref;
use std::ptr::NonNull;
use std::sync::LazyLock;
use std::{iter, mem, hash::{Hash, Hasher}};
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps, MallocUnconditionalSizeOf};
@@ -44,12 +45,9 @@ impl<T> Clone for ArcSlice<T> {
}
}
lazy_static! {
// ThinArc doesn't support alignments greater than align_of::<u64>.
static ref EMPTY_ARC_SLICE: ArcSlice<u64> = {
ArcSlice::from_iter_leaked(iter::empty())
};
}
// ThinArc doesn't support alignments greater than align_of::<u64>.
static EMPTY_ARC_SLICE: LazyLock<ArcSlice<u64>> =
LazyLock::new(|| ArcSlice::from_iter_leaked(iter::empty()));
impl<T> Default for ArcSlice<T> {
#[allow(unsafe_code)]

View File

@@ -10,31 +10,16 @@
#![crate_type = "rlib"]
#![deny(unsafe_code, missing_docs)]
extern crate app_units;
#[macro_use]
extern crate bitflags;
extern crate cssparser;
extern crate euclid;
#[macro_use]
extern crate lazy_static;
extern crate malloc_size_of;
#[macro_use]
extern crate malloc_size_of_derive;
#[cfg(feature = "gecko")]
extern crate nsstring;
extern crate selectors;
#[macro_use]
extern crate serde;
extern crate servo_arc;
#[cfg(feature = "servo")]
extern crate servo_atoms;
extern crate thin_vec;
extern crate to_shmem;
#[macro_use]
extern crate to_shmem_derive;
#[cfg(feature = "servo")]
extern crate url;
extern crate url;
use bitflags::bitflags;
use cssparser::{CowRcStr, Token};
use selectors::parser::SelectorParseErrorKind;
#[cfg(feature = "servo")]