diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /vendor/tinyvec_macros | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/tinyvec_macros')
-rw-r--r-- | vendor/tinyvec_macros/.cargo-checksum.json | 1 | ||||
-rw-r--r-- | vendor/tinyvec_macros/Cargo.toml | 22 | ||||
-rw-r--r-- | vendor/tinyvec_macros/LICENSE | 21 | ||||
-rw-r--r-- | vendor/tinyvec_macros/src/lib.rs | 24 |
4 files changed, 68 insertions, 0 deletions
diff --git a/vendor/tinyvec_macros/.cargo-checksum.json b/vendor/tinyvec_macros/.cargo-checksum.json new file mode 100644 index 000000000..89971f54c --- /dev/null +++ b/vendor/tinyvec_macros/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"4d9215939ee768922a558f51f2782240b4c8b26785ab3a6e894e06086064aa77","LICENSE":"1dd8eca0f83669e75fa119e34fb9e1be9d16e3e9b6368962b8019db6e8ae5f7b","src/lib.rs":"5e07533db455ed4bad8375ec704dc16b9f5fd0ed4fc46e281a4856a65b79c3fb"},"package":"cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"}
\ No newline at end of file diff --git a/vendor/tinyvec_macros/Cargo.toml b/vendor/tinyvec_macros/Cargo.toml new file mode 100644 index 000000000..02baededc --- /dev/null +++ b/vendor/tinyvec_macros/Cargo.toml @@ -0,0 +1,22 @@ +# 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 = "tinyvec_macros" +version = "0.1.0" +authors = ["Soveu <marx.tomasz@gmail.com>"] +description = "Some macros for tiny containers" +license = "MIT OR Apache-2.0 OR Zlib" +repository = "https://github.com/Soveu/tinyvec_macros" + +[dependencies] diff --git a/vendor/tinyvec_macros/LICENSE b/vendor/tinyvec_macros/LICENSE new file mode 100644 index 000000000..4a8554df7 --- /dev/null +++ b/vendor/tinyvec_macros/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Soveu + +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. diff --git a/vendor/tinyvec_macros/src/lib.rs b/vendor/tinyvec_macros/src/lib.rs new file mode 100644 index 000000000..4790e08a0 --- /dev/null +++ b/vendor/tinyvec_macros/src/lib.rs @@ -0,0 +1,24 @@ +#![no_std] + +#[macro_export] +macro_rules! impl_mirrored { + { + type Mirror = $tinyname:ident; + $( + $(#[$attr:meta])* + $v:vis fn $fname:ident ($seif:ident : $seifty:ty $(,$argname:ident : $argtype:ty)*) $(-> $ret:ty)? ; + )* + } => { + $( + $(#[$attr])* + #[inline(always)] + $v fn $fname($seif : $seifty, $($argname: $argtype),*) $(-> $ret)? { + match $seif { + $tinyname::Inline(i) => i.$fname($($argname),*), + $tinyname::Heap(h) => h.$fname($($argname),*), + } + } + )* + }; +} + |