Skip to content

RoDmitry/debug_unsafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debug Unsafe (Rust)

Crate API

Uses debug-assertions compiler flag as a switch of safe/unsafe behaviour. It's mainly used for tests to trigger panic instead of UB in unsafe calls.

If you want an extra safe (but less performant) behaviour, or need to catch an UB, you can enable debug-assertions (safe behaviour):

  • only for this library in Cargo.toml with:

    [profile.release.package.debug_unsafe]
    debug-assertions = true
  • globally in a command line with: RUSTFLAGS="-C debug-assertions" cargo build --release (requires cargo clean first, if it was previously built without the flag).

About

Uses `debug-assertions` as a switch of safe/unsafe behaviour

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Contributors

Languages