From 4e2948c61093d1e5d538dd7f03f4b7de164142bc Mon Sep 17 00:00:00 2001 From: Alona Enraght-Moony Date: Fri, 31 May 2024 16:19:09 +0100 Subject: [PATCH] Remove `memoffset` dependency. `std::mem::offset` has been availible on stable since 1.77.0. `memoffset` uses this when compiled against a recent enough rustc. Moving to the implementation in `std` lets us drop both `memoffset` and `autocfg` from our dependencies. --- Cargo.toml | 3 +-- src/arc.rs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5c5bba7..879c77d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ repository = "https://github.com/rust-analyzer/rowan" license = "MIT OR Apache-2.0" description = "Library for generic lossless syntax trees" edition = "2021" - +rust-version = "1.77.0" exclude = [".github/", "bors.toml", "rustfmt.toml"] [workspace] @@ -18,7 +18,6 @@ hashbrown = { version = "0.14.3", features = [ "inline-more", ], default-features = false } text-size = "1.1.0" -memoffset = "0.9" countme = "3.0.0" serde = { version = "1.0.89", optional = true, default-features = false } diff --git a/src/arc.rs b/src/arc.rs index 7adf45e..cb6758e 100644 --- a/src/arc.rs +++ b/src/arc.rs @@ -4,7 +4,7 @@ use std::{ cmp::Ordering, hash::{Hash, Hasher}, marker::PhantomData, - mem::{self, ManuallyDrop}, + mem::{self, offset_of, ManuallyDrop}, ops::Deref, ptr, sync::atomic::{ @@ -13,8 +13,6 @@ use std::{ }, }; -use memoffset::offset_of; - /// A soft limit on the amount of references that may be made to an `Arc`. /// /// Going above this limit will abort your program (although not