File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 22name = " smolbitset"
33version = " 0.1.0"
44edition = " 2024"
5- rust-version = " 1.85 .0"
5+ rust-version = " 1.89 .0"
66
77[features ]
88default = [" std" ]
Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ Any larger values dynamically allocate an appropriately sized `u32` slice on the
1414[ docs-badge ] : https://img.shields.io/badge/docs-online-5023dd.svg?style=flat-square
1515[ crates.io link ] : https://crates.io/crates/smolbitset
1616[ crates.io version ] : https://img.shields.io/crates/v/smolbitset.svg?style=flat-square
17- [ rust-version-badge ] : https://img.shields.io/badge/rust-1.85 .0+-93450a.svg?style=flat-square
18- [ rust-version-link ] : https://blog.rust-lang.org/2025/02/20 /Rust-1.85.0.html
17+ [ rust-version-badge ] : https://img.shields.io/badge/rust-1.89 .0+-93450a.svg?style=flat-square
18+ [ rust-version-link ] : https://blog.rust-lang.org/2025/08/07 /Rust-1.89.0/
Original file line number Diff line number Diff line change 2626
2727use core:: convert:: Infallible ;
2828use core:: mem:: MaybeUninit ;
29- use core:: ptr:: { self , NonNull } ;
29+ use core:: num:: NonZero ;
30+ use core:: ptr:: NonNull ;
3031
3132/// Returns the index of the most significant bit set to 1 in the given data.
3233///
@@ -69,10 +70,7 @@ impl SmolBitSet {
6970 #[ must_use]
7071 #[ inline]
7172 pub const fn new ( ) -> Self {
72- let ptr = unsafe { NonNull :: new_unchecked ( ptr:: without_provenance_mut ( 0b1 ) ) } ;
73-
74- // #![feature(nonnull_provenance)] -> https://github.com/rust-lang/rust/issues/135243
75- // let ptr = NonNull::without_provenance(core::num::NonZero::<usize>::MIN);
73+ let ptr = NonNull :: without_provenance ( core:: num:: NonZero :: < usize > :: MIN ) ;
7674
7775 Self { ptr }
7876 }
@@ -190,8 +188,8 @@ impl SmolBitSet {
190188
191189 #[ inline]
192190 const unsafe fn write_inline_data_unchecked ( & mut self , data : usize ) {
193- self . ptr =
194- unsafe { NonNull :: new_unchecked ( ptr :: without_provenance_mut ( ( data << 1 ) | 0b1 ) ) } ;
191+ let addr = unsafe { NonZero :: new_unchecked ( ( data << 1 ) | 0b1 ) } ;
192+ self . ptr = NonNull :: without_provenance ( addr ) ;
195193 }
196194
197195 #[ inline]
You can’t perform that action at this time.
0 commit comments