We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0681b97 commit 5c9369fCopy full SHA for 5c9369f
static-alloc/src/unsync/bump.rs
@@ -251,10 +251,7 @@ impl MemBump {
251
/// This is how many *bytes* can be allocated
252
/// within this node.
253
pub const fn capacity(&self) -> usize {
254
- // Safety: just gets the pointer metadata `len` without invalidating any provenance,
255
- // accepting the pointer use itself. This may be replaced by a safe `pointer::len` as soon
256
- // as stable (#71146) and const which would avoid any pointer use.
257
- unsafe { (*(self.data.get() as *const [UnsafeCell<u8>])).len() }
+ self.data.get().len()
258
}
259
260
/// Get a raw pointer to the data.
0 commit comments