new_debug_unreachable-1.0.1/.gitignore010064400017500001750000000002071330433657200162170ustar0000000000000000.DS_Store *~ *# *.o *.so *.swp *.dylib *.dSYM *.dll *.rlib *.dummy *.exe *-test /doc/ /target/ /examples/* !/examples/*.rs Cargo.lock new_debug_unreachable-1.0.1/.travis.yml010064400017500001750000000000171330433657200163370ustar0000000000000000language: rust new_debug_unreachable-1.0.1/Cargo.toml.orig010064400017500001750000000007631330501014400171060ustar0000000000000000[package] name = "new_debug_unreachable" version = "1.0.1" authors = ["Matt Brubeck ", "Jonathan Reem "] repository = "https://github.com/mbrubeck/rust-debug-unreachable" description = "panic in debug, intrinsics::unreachable() in release (fork of debug_unreachable)" documentation = "https://docs.rs/new_debug_unreachable" readme = "README.md" license = "MIT" [lib] name = "debug_unreachable" path = "src/lib.rs" [dependencies] unreachable = "1.0" new_debug_unreachable-1.0.1/Cargo.toml0000644000000020040000000000000133540ustar00# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g. crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "new_debug_unreachable" version = "1.0.1" authors = ["Matt Brubeck ", "Jonathan Reem "] description = "panic in debug, intrinsics::unreachable() in release (fork of debug_unreachable)" documentation = "https://docs.rs/new_debug_unreachable" readme = "README.md" license = "MIT" repository = "https://github.com/mbrubeck/rust-debug-unreachable" [lib] name = "debug_unreachable" path = "src/lib.rs" [dependencies.unreachable] version = "1.0" new_debug_unreachable-1.0.1/LICENSE-MIT010064400017500001750000000020411330434264100156530ustar0000000000000000Copyright (c) 2015 Jonathan Reem Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. new_debug_unreachable-1.0.1/README.md010064400017500001750000000011361330434304600155020ustar0000000000000000# new_debug_unreachable > unreachable!() in debug, std::intrinsics::unreachable() in release. This is a fork of [`debug_unreachable`](https://crates.io/crates/debug_unreachable). ## [Documentation](https://docs.rs/new_debug_unreachable) ## Usage Use the crates.io repository; add this to your `Cargo.toml` along with the rest of your dependencies: ```toml [dependencies] new_debug_unreachable = "1.0" ``` ## Author [Jonathan Reem](https://medium.com/@jreem) is the original author of debug-unreachable. [Matt Brubeck](https://limpet.net/mbrubeck/) is the maintainer of this fork. ## License MIT new_debug_unreachable-1.0.1/examples/simple.rs010064400017500001750000000003061330433657200177040ustar0000000000000000#[macro_use] extern crate debug_unreachable; fn main() { if 0 > 100 { // Can't happen! unsafe { debug_unreachable!() } } else { println!("Good, 0 <= 100."); } } new_debug_unreachable-1.0.1/src/lib.rs010064400017500001750000000010171330434267100161270ustar0000000000000000#![deny(missing_docs, warnings)] #![no_std] //! `panic!()` in debug builds, optimization hint in release. extern crate unreachable; #[doc(hidden)] pub use unreachable::unreachable as __unreachable; #[macro_export] /// `panic!()` in debug builds, optimization hint in release. macro_rules! debug_unreachable { () => { debug_unreachable!("entered unreachable code") }; ($e:expr) => { if cfg!(debug_assertions) { panic!($e); } else { $crate::__unreachable() } } } new_debug_unreachable-1.0.1/tests/check.rs010064400017500001750000000002061330433657200170130ustar0000000000000000#[macro_use] extern crate debug_unreachable; #[test] #[should_panic] fn explodes_in_debug() { unsafe { debug_unreachable!() } }