Vendor things

This commit is contained in:
John Doty 2024-03-08 11:03:01 -08:00
parent 5deceec006
commit 977e3c17e5
19434 changed files with 10682014 additions and 0 deletions

View file

@ -0,0 +1 @@
{"files":{"Cargo.lock":"438cea17a96e11f787f827aab8c4fe2d096d75b1db95b5749339b9d2b2554d5b","Cargo.toml":"bcaf0900427df4f1e1f61bfaf99ec22422be14b97432ace1287e52803e9c6f0b","LICENSE-MIT":"f7715d38a3fa1b4ac97c5729740752505a39cb92ee83ab5b102aeb5eaa7cdea4","README.md":"614d60e78bd8c3d8172b2650f86d44c703471dab8a35805736861f09158e5501","examples/simple.rs":"f1fac7f8308469568b601218ea03d213584f0a51b779a3bcb78ecb40ede72483","src/lib.rs":"5a2cbd34e3a52ea1a8e1b31dd34c5ec31ce549fec30f60a0e20b87d8138da416","tests/check.rs":"323e500890599105193b6b07563a2c570ea0cc56342c81670075e5fd2ff467d1"},"package":"e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"}

6
third-party/vendor/new_debug_unreachable/Cargo.lock generated vendored Normal file
View file

@ -0,0 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "new_debug_unreachable"
version = "1.0.4"

View file

@ -0,0 +1,26 @@
# 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]
edition = "2018"
name = "new_debug_unreachable"
version = "1.0.4"
authors = ["Matt Brubeck <mbrubeck@limpet.net>", "Jonathan Reem <jonathan.reem@gmail.com>"]
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"

View file

@ -0,0 +1,25 @@
Copyright (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.

View file

@ -0,0 +1,42 @@
# 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"
```
In your Rust code, the library name is still `debug_unreachable`:
```rust
use debug_unreachable::debug_unreachable;
fn main() {
if 0 > 100 {
// Can't happen!
unsafe { debug_unreachable!() }
} else {
println!("Good, 0 <= 100.");
}
}
```
## 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

View file

@ -0,0 +1,10 @@
use debug_unreachable::debug_unreachable;
fn main() {
if 0 > 100 {
// Can't happen!
unsafe { debug_unreachable!() }
} else {
println!("Good, 0 <= 100.");
}
}

View file

@ -0,0 +1,36 @@
#![deny(missing_docs, warnings)]
#![no_std]
//! `panic!()` in debug builds, optimization hint in release.
#[doc(hidden)] pub mod _internal { pub use core::hint::unreachable_unchecked; }
#[macro_export]
/// `panic!()` in debug builds, optimization hint in release.
///
/// Example:
///
/// ```
/// use debug_unreachable::debug_unreachable;
///
/// fn main() {
/// if 0 > 100 {
/// // Can't happen!
/// unsafe { debug_unreachable!() }
/// } else {
/// println!("Good, 0 <= 100.");
/// }
/// }
/// ```
macro_rules! debug_unreachable {
() => { debug_unreachable!("entered unreachable code") };
($e:expr) => {
if cfg!(debug_assertions) {
panic!($e)
} else {
$crate::_internal::unreachable_unchecked()
}
}
}

View file

@ -0,0 +1,8 @@
#[test]
#[should_panic]
#[cfg(debug_assertions)]
fn explodes_in_debug() {
use debug_unreachable::debug_unreachable;
unsafe { debug_unreachable!() }
}