Skip to content

Commit

Permalink
lower the msrv
Browse files Browse the repository at this point in the history
  • Loading branch information
gkgoat1 committed Nov 23, 2024
1 parent 72b8344 commit cf65d06
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ used_linker = ["linkme-impl/used_linker"]
[dependencies]
linkme-impl = { version = "=0.3.31", path = "impl" }

[target.'cfg(target_family = "wasm")'.dependencies]
once_cell = "1.20.2"


[dev-dependencies]
once_cell = "1.16"
rustversion = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion impl/src/declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn expand(input: TokenStream) -> TokenStream {
fn _init(a: *mut <#ty as #linkme_path::__private::Slice>::Element) -> *mut <#ty as #linkme_path::__private::Slice>::Element;
fn _len() -> usize;
}
static lazy: #linkme_path::__private::std::sync::OnceLock<#linkme_path::__private::StaticPtr<<#ty as #linkme_path::__private::Slice>::Element>> = #linkme_path::__private::std::sync::OnceLock::new();
static lazy: #linkme_path::__private::once_cell::sync::OnceCell<#linkme_path::__private::StaticPtr<<#ty as #linkme_path::__private::Slice>::Element>> = #linkme_path::__private::std::sync::OnceLock::new();
unsafe{
#linkme_path::DistributedSlice::private_new(#name,_init,_len,&lazy)
}
Expand Down
2 changes: 1 addition & 1 deletion src/distributed_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub struct DistributedSlice<T: ?Sized + Slice> {
#[cfg(not(target_family = "wasm"))]
dupcheck_stop: StaticPtr<usize>,
#[cfg(target_family = "wasm")]
lazy: &'static ::std::sync::OnceLock<StaticPtr<T::Element>>,
lazy: &'static ::once_cell::sync::OnceCell<StaticPtr<T::Element>>,
#[cfg(target_family = "wasm")]
init: unsafe fn(*mut T::Element) -> *mut T::Element,
#[cfg(target_family = "wasm")]
Expand Down
4 changes: 4 additions & 0 deletions src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ pub use core::ptr;
#[doc(hidden)]
pub use std;

#[cfg(target_family = "wasm")]
#[doc(hidden)]
pub use once_cell;

#[doc(hidden)]
pub trait Slice {
type Element;
Expand Down

0 comments on commit cf65d06

Please sign in to comment.