mirror of
https://github.com/bevyengine/bevy
synced 2024-12-23 11:33:06 +00:00
eb2a8b12e9
# Objective `bevy_ptr` works just fine without `std`. Mark it as `no_std`. This should generally be useful for non-bevy use cases, but it also marginally speeds up compilation by allowing the crate to compile without loading the std-lib. ## Solution Replace `std` with `core`. Added `#![no_std]` to the crate and to the crate's tags. Also added a missing `#![warn(missing_docs)]` that the other crates have. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |
bevy_ptr
The bevy_ptr
crate provides low-level abstractions for working with pointers in a more safe way than using rust's raw pointers.
Rust has lifetimed and typed references (&'a T
), unlifetimed and typed references (*const T
), but no lifetimed but untyped references.
bevy_ptr
adds them, called Ptr<'a>
, PtrMut<'a>
and OwningPtr<'a>
.
These types are lifetime-checked so can never lead to problems like use-after-frees and must always point to valid data.