Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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