Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/10maurycy10/safe
A collection of unsound rust functions using entirely safe code.
https://github.com/10maurycy10/safe
Last synced: 11 days ago
JSON representation
A collection of unsound rust functions using entirely safe code.
- Host: GitHub
- URL: https://github.com/10maurycy10/safe
- Owner: 10maurycy10
- Created: 2022-02-16T20:58:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-16T21:09:55.000Z (almost 3 years ago)
- Last Synced: 2024-11-20T21:58:49.565Z (2 months ago)
- Language: Rust
- Homepage:
- Size: 1.95 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# safe
## A collection of unsound rust functions, alowing you to:
- preform unchecked type casts ``std::mem::transmute`` style.
- create ``&'static T`` from ``&T``
- create ``&'static mut`` T from ``&mut T``
- Raw memory read (get data at address)
- Raw memory write (set data at address)
- Convert a ``&T`` into ``&'static mut T``
## All safe code!
look at ``src/lib.rs`` and the deps, no ``unsafe`` to be found!
This works by exploiting a long standing compiler bug: https://github.com/rust-lang/rust/issues/25860 aka ``fake-static`` bug