Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1 @@
{"files":{"Cargo.toml":"8d265c4f6d6f71a27e1671cc712dbe77274dae1431f455b99b347b8650c1ece0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"ce592787ff2321feab698a4c612237f4378cc658ebb1d472913e5802cc47afb4","README.md":"6fd4e5b612e6e23c354afb49340542f150dccef380461581a4a24490bced73dd","src/block/avx.rs":"ebdfa85c3692f164d8934bc2ec38924730cfb8cee2f98cfe565376d35969fbd7","src/block/avx2.rs":"c6a0aae98abb06c8a2eadecd64ce012a4b11c03e1b406fa78e667d4ab1b8d4ae","src/block/default.rs":"f86de8ab1097ed4daa71cee927b1742bd6c4bfb7b7a568a8458055e1077522bf","src/block/mod.rs":"a3987ac6bd5116e0d2d8bb3ebdd79a860802ca4bc077166d60b0911fd979b334","src/block/sse2.rs":"c3d59f76daf0d0a37730340fdbaf1866221e55ab2efea3e1fe156cfcbc3cc560","src/block/wasm.rs":"83f7807f8c5f74881eb1956e37bec6fd1b03c7311355aa960618f9868d670062","src/lib.rs":"58c749d9ed8e27c3750db1490e01c59bf524c5a098415e95b75652d0373a5903","src/range.rs":"28b53952f40b3e6bf83efc1e427c671c94d6ce4b3a76b6c5d1f766e965f71911","src/serde_impl.rs":"0741352978b722c44d33a0cdd3e987055c296aa55f9ac3448edec4951a472937","tests/tests.rs":"6026b6a46ad2c8fb4057557fb0f7128a22577fb21d01b5ac357d0c026068400b"},"package":"1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99"}

45
vendor/fixedbitset/Cargo.toml vendored Normal file
View File

@@ -0,0 +1,45 @@
# 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 are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.56"
name = "fixedbitset"
version = "0.5.7"
authors = ["bluss"]
description = "FixedBitSet is a simple bitset collection"
documentation = "https://docs.rs/fixedbitset/"
readme = "README.md"
keywords = [
"container",
"data-structure",
"bitvec",
"bitset",
"no_std",
]
categories = ["data-structures"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/petgraph/fixedbitset"
[package.metadata.release]
no-dev-version = true
tag-name = "{{version}}"
[dependencies.serde]
version = "1.0"
optional = true
[dev-dependencies.serde_json]
version = "1.0"
[features]
default = ["std"]
std = []

201
vendor/fixedbitset/LICENSE-APACHE vendored Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

25
vendor/fixedbitset/LICENSE-MIT vendored Normal file
View File

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

125
vendor/fixedbitset/README.md vendored Normal file
View File

@@ -0,0 +1,125 @@
fixedbitset
---
A simple fixed size bitset container for Rust.
Please read the [API documentation here](https://docs.rs/fixedbitset/)
[![build\_status](https://github.com/petgraph/fixedbitset/workflows/Continuous%20integration/badge.svg?branch=master)](https://github.com/petgraph/fixedbitset/actions)
[![crates](https://img.shields.io/crates/v/fixedbitset.svg)](https://crates.io/crates/fixedbitset)
# Recent Changes
- 0.5.7
- [#127](https://github.com/petgraph/fixedbitset/pull/127) and [#128](https://github.com/petgraph/fixedbitset/pull/128): Optimize `Clone::clone_from` to avoid
extra allocations and copies.
- 0.5.6
- Fixed FixedBitset not implementing Send/Sync due to the stack size shrink.
- 0.5.5 (yanked)
- [#116](https://github.com/petgraph/fixedbitset/pull/116): Add functions for counting the results of a set operation (`union_count`,
`intersection_count`, `difference_count`, `symmetric_difference_count`) by @james7132.
- [#118](https://github.com/petgraph/fixedbitset/pull/118): Shrink the stack size of FixedBitset. There should be zero stack size overhead
compared to a Vec.
- [#119](https://github.com/petgraph/fixedbitset/pull/119): Fix builds for wasm32.
- [#120](https://github.com/petgraph/fixedbitset/pull/119): Add more utility functions that were previously missing from the public interface:
`contains_any_in_range`, `contains_all_in_range`, `minimum`, `maximum`, `is_full`, `count_zeroes`, and `remove_range`.
- [#121](https://github.com/petgraph/fixedbitset/pull/121): Add support for SIMD acceleration for AVX builds.
- 0.5.4
- [#112](https://github.com/petgraph/fixedbitset/pull/112): Fix undefined behavior in IntoOnes and setup testing with MIRI by @SkiFire13
- 0.5.3 (yanked)
- [#109](https://github.com/petgraph/fixedbitset/pull/109): Fix non-x86(_64) builds by @james7132
- 0.5.2 (yanked)
- [#86](https://github.com/petgraph/fixedbitset/pull/86): Explicit SIMD vectorization for set operations by @james7132.
- 0.5.1
- [#102](https://github.com/petgraph/fixedbitset/pull/102): Added `contains_unchecked`, `insert_unchecked`, `put_unchecked`,
`set_unchecked`, `toggle_unchecked`, `removed_unchecked`, `copy_bit_unchecked` unsafe variants of the safe functions, by @james7132
- [#103](https://github.com/petgraph/fixedbitset/pull/103): Added `into_ones` which returns a owned iterator over the one
values from a bitset, by @james7132.
- [#104](https://github.com/petgraph/fixedbitset/pull/104): Implemented `DoubleEndedIterator` for `Union`, `Intersection`,
`Difference`, and `SymmetricDifference` , by @james7132.
- 0.5.0
- [#74](https://github.com/petgraph/fixedbitset/pull/74): Accelerated set operations (union, intersection, difference,
symmetric difference) by using larger blocks internally, by @james7132.
- [#88](https://github.com/petgraph/fixedbitset/pull/88): Added `FixedBitSet::remove` by @james7132.
- [#89](https://github.com/petgraph/fixedbitset/pull/89): Added `FixedBitSet::zeros` and the `Zeros` iterator by @james7132.
- [#92](https://github.com/petgraph/fixedbitset/pull/92): Added `FixedBitSet::grow_and_insert` function, a
non-panicking version of `insert` that grows the underlying storage as need, by @shuoli84.
- [#98](https://github.com/petgraph/fixedbitset/pull/98): `Ones` now implements `DoubleEndedIterator`, by @tikhu.
- [#99](https://github.com/petgraph/fixedbitset/pull/99): **Breaking change**: serde now serializes and deserializes from a little-endian encoded
raw byte buffer. Existing stored instances of the serialized bitsets will need to be
re-encoded.
- Bumped MSRV to 1.56.
- 0.4.2
- [#79](https://github.com/petgraph/fixedbitset/pull/79): Add `is_clear`,
clarify `is_empty` and `len` documentation by \@nicopap.
- 0.4.1
- Documentation and formatting fixes.
- 0.4.0
- [#61](https://github.com/petgraph/fixedbitset/pull/61): Require
Rust 1.39.
- [#60](https://github.com/petgraph/fixedbitset/pull/60): Add
`const` `FixedBitSet::new` consructor
by \@jakobhellermann.
- [#59](https://github.com/petgraph/fixedbitset/pull/59): Add
optional `serde` support by \@keshavsn.
- 0.3.2
- [#18](https://github.com/petgraph/fixedbitset/pull/18): Optimize
`ones` using `trailing_zeroes` by \@vks
- 0.3.1
- Add bit assign operators for references by \@flaghacker
- Improve assertion error messages by \@lovasoa
- Add documentation examples for `with_capacity_and_blocks`
- 0.3.0
- Add `with_capacity_and_blocks` by \@luizirber
- Add `difference_with` by \@sunshowers
- Implement `Binary` and `Display` traits by \@Dolphindalt
- Add `toggle_range` by \@wirelyre
- 0.2.0
- Add assign operators for the bit operations by \@jrraymond
- Add `symmetric_difference`, `union_with`, `intersection_with` by
\@jrraymond
- Add `is_subset`, `is_superset`, `is_disjoint` by \@nwn
- Add `.toggle(i)` method by \@ShiroUsagi-san
- Add default feature \"std\" which can be disabled to make the
crate not link the std library. By \@jonimake and \@bluss
- Require Rust 1.31.
- 0.1.9
- Add intersection, union, difference iterators by \@jrraymond
- Add intersection: `&` and union: `|` operator implementations by
\@jrraymond
- Add Extend and FromIterator implementations (from sequences of
bit indices) by \@jrraymond
- 0.1.8
- Add missing `#[inline]` on the ones iterator
- Fix docs for `insert_range, set_range`
- 0.1.7
- Add fast methods `.insert_range`, `.set_range` by \@kennytm
- 0.1.6
- Add iterator `.ones()` by \@mneumann
- Fix bug with `.count_ones()` where it would erronously have an
out-of-bounds panic for even block endpoints
- 0.1.5
- Add method `.count_ones(range)`.
- 0.1.4
- Remove an assertion in `.copy_bit(from, to)` so that it is in
line with the documentation. The `from` bit does not need to be
in bounds.
- Improve `.grow()` to use `Vec::resize` internally.
- 0.1.3
- Add method `.put()` to enable a bit and return previous value
- 0.1.2
- Add method `.copy_bit()` (by fuine)
- impl Default
- 0.1.1
- Update documentation URL
- 0.1.0
- Add method `.grow()`
# License
Dual-licensed to be compatible with the Rust project.
Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
or the [MIT license](https://opensource.org/licenses/MIT),
at your option. This file may not be copied, modified, or distributed except
according to those terms.

92
vendor/fixedbitset/src/block/avx.rs vendored Normal file
View File

@@ -0,0 +1,92 @@
#[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not};
#[derive(Copy, Clone, Debug)]
#[repr(transparent)]
pub struct Block(pub(super) __m256d);
impl Block {
#[inline]
pub fn is_empty(self) -> bool {
unsafe {
let value = _mm256_castpd_si256(self.0);
_mm256_testz_si256(value, value) == 1
}
}
#[inline]
pub fn andnot(self, other: Self) -> Self {
unsafe { Self(_mm256_andnot_pd(other.0, self.0)) }
}
}
impl Not for Block {
type Output = Block;
#[inline]
fn not(self) -> Self::Output {
unsafe { Self(_mm256_xor_pd(self.0, Self::ALL.0)) }
}
}
impl BitAnd for Block {
type Output = Block;
#[inline]
fn bitand(self, other: Self) -> Self::Output {
unsafe { Self(_mm256_and_pd(self.0, other.0)) }
}
}
impl BitAndAssign for Block {
#[inline]
fn bitand_assign(&mut self, other: Self) {
unsafe {
self.0 = _mm256_and_pd(self.0, other.0);
}
}
}
impl BitOr for Block {
type Output = Block;
#[inline]
fn bitor(self, other: Self) -> Self::Output {
unsafe { Self(_mm256_or_pd(self.0, other.0)) }
}
}
impl BitOrAssign for Block {
#[inline]
fn bitor_assign(&mut self, other: Self) {
unsafe {
self.0 = _mm256_or_pd(self.0, other.0);
}
}
}
impl BitXor for Block {
type Output = Block;
#[inline]
fn bitxor(self, other: Self) -> Self::Output {
unsafe { Self(_mm256_xor_pd(self.0, other.0)) }
}
}
impl BitXorAssign for Block {
#[inline]
fn bitxor_assign(&mut self, other: Self) {
unsafe { self.0 = _mm256_xor_pd(self.0, other.0) }
}
}
impl PartialEq for Block {
#[inline]
fn eq(&self, other: &Self) -> bool {
unsafe {
let new = _mm256_xor_pd(self.0, other.0);
let neq = _mm256_castpd_si256(new);
_mm256_testz_si256(neq, neq) == 1
}
}
}

88
vendor/fixedbitset/src/block/avx2.rs vendored Normal file
View File

@@ -0,0 +1,88 @@
#[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not};
#[derive(Copy, Clone, Debug)]
#[repr(transparent)]
pub struct Block(pub(super) __m256i);
impl Block {
#[inline]
pub fn is_empty(self) -> bool {
unsafe { _mm256_testz_si256(self.0, self.0) == 1 }
}
#[inline]
pub fn andnot(self, other: Self) -> Self {
Self(unsafe { _mm256_andnot_si256(other.0, self.0) })
}
}
impl Not for Block {
type Output = Block;
#[inline]
fn not(self) -> Self::Output {
unsafe { Self(_mm256_xor_si256(self.0, Self::ALL.0)) }
}
}
impl BitAnd for Block {
type Output = Block;
#[inline]
fn bitand(self, other: Self) -> Self::Output {
unsafe { Self(_mm256_and_si256(self.0, other.0)) }
}
}
impl BitAndAssign for Block {
#[inline]
fn bitand_assign(&mut self, other: Self) {
unsafe {
self.0 = _mm256_and_si256(self.0, other.0);
}
}
}
impl BitOr for Block {
type Output = Block;
#[inline]
fn bitor(self, other: Self) -> Self::Output {
unsafe { Self(_mm256_or_si256(self.0, other.0)) }
}
}
impl BitOrAssign for Block {
#[inline]
fn bitor_assign(&mut self, other: Self) {
unsafe {
self.0 = _mm256_or_si256(self.0, other.0);
}
}
}
impl BitXor for Block {
type Output = Block;
#[inline]
fn bitxor(self, other: Self) -> Self::Output {
unsafe { Self(_mm256_xor_si256(self.0, other.0)) }
}
}
impl BitXorAssign for Block {
#[inline]
fn bitxor_assign(&mut self, other: Self) {
unsafe { self.0 = _mm256_xor_si256(self.0, other.0) }
}
}
impl PartialEq for Block {
#[inline]
fn eq(&self, other: &Self) -> bool {
unsafe {
let neq = _mm256_xor_si256(self.0, other.0);
_mm256_testz_si256(neq, neq) == 1
}
}
}

70
vendor/fixedbitset/src/block/default.rs vendored Normal file
View File

@@ -0,0 +1,70 @@
use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not};
#[derive(Copy, Clone, PartialEq, Debug)]
#[repr(transparent)]
pub struct Block(pub(super) usize);
impl Block {
#[inline]
pub const fn is_empty(self) -> bool {
self.0 == Self::NONE.0
}
#[inline]
pub fn andnot(self, other: Self) -> Self {
Self(!other.0 & self.0)
}
}
impl Not for Block {
type Output = Block;
#[inline]
fn not(self) -> Self::Output {
Self(self.0.not())
}
}
impl BitAnd for Block {
type Output = Block;
#[inline]
fn bitand(self, other: Self) -> Self::Output {
Self(self.0.bitand(other.0))
}
}
impl BitAndAssign for Block {
#[inline]
fn bitand_assign(&mut self, other: Self) {
self.0.bitand_assign(other.0);
}
}
impl BitOr for Block {
type Output = Block;
#[inline]
fn bitor(self, other: Self) -> Self::Output {
Self(self.0.bitor(other.0))
}
}
impl BitOrAssign for Block {
#[inline]
fn bitor_assign(&mut self, other: Self) {
self.0.bitor_assign(other.0)
}
}
impl BitXor for Block {
type Output = Block;
#[inline]
fn bitxor(self, other: Self) -> Self::Output {
Self(self.0.bitxor(other.0))
}
}
impl BitXorAssign for Block {
#[inline]
fn bitxor_assign(&mut self, other: Self) {
self.0.bitxor_assign(other.0)
}
}

114
vendor/fixedbitset/src/block/mod.rs vendored Normal file
View File

@@ -0,0 +1,114 @@
#![allow(clippy::undocumented_unsafe_blocks)]
#![allow(dead_code)]
// TODO: Remove once the transmutes are fixed
#![allow(unknown_lints)]
#![allow(clippy::missing_transmute_annotations)]
use core::cmp::Ordering;
use core::hash::{Hash, Hasher};
#[cfg(all(
not(all(target_family = "wasm", target_feature = "simd128")),
not(target_feature = "sse2"),
not(target_feature = "avx"),
not(target_feature = "avx2"),
))]
mod default;
#[cfg(all(
not(all(target_family = "wasm", target_feature = "simd128")),
not(target_feature = "sse2"),
not(target_feature = "avx"),
not(target_feature = "avx2"),
))]
pub use self::default::*;
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "sse2",
not(target_feature = "avx"),
not(target_feature = "avx2"),
))]
mod sse2;
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "sse2",
not(target_feature = "avx"),
not(target_feature = "avx2"),
))]
pub use self::sse2::*;
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "avx",
not(target_feature = "avx2")
))]
mod avx;
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "avx",
not(target_feature = "avx2")
))]
pub use self::avx::*;
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "avx2"
))]
mod avx2;
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
target_feature = "avx2"
))]
pub use self::avx2::*;
#[cfg(all(target_family = "wasm", target_feature = "simd128"))]
mod wasm;
#[cfg(all(target_family = "wasm", target_feature = "simd128"))]
pub use self::wasm::*;
impl Block {
pub const USIZE_COUNT: usize = core::mem::size_of::<Self>() / core::mem::size_of::<usize>();
pub const NONE: Self = Self::from_usize_array([0; Self::USIZE_COUNT]);
pub const ALL: Self = Self::from_usize_array([usize::MAX; Self::USIZE_COUNT]);
pub const BITS: usize = core::mem::size_of::<Self>() * 8;
#[inline]
pub fn into_usize_array(self) -> [usize; Self::USIZE_COUNT] {
unsafe { core::mem::transmute(self.0) }
}
#[inline]
pub const fn from_usize_array(array: [usize; Self::USIZE_COUNT]) -> Self {
Self(unsafe { core::mem::transmute(array) })
}
}
impl Eq for Block {}
impl PartialOrd for Block {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for Block {
#[inline]
fn cmp(&self, other: &Self) -> Ordering {
self.into_usize_array().cmp(&other.into_usize_array())
}
}
impl Default for Block {
#[inline]
fn default() -> Self {
Self::NONE
}
}
impl Hash for Block {
#[inline]
fn hash<H: Hasher>(&self, hasher: &mut H) {
Hash::hash_slice(&self.into_usize_array(), hasher);
}
}

104
vendor/fixedbitset/src/block/sse2.rs vendored Normal file
View File

@@ -0,0 +1,104 @@
#![allow(clippy::undocumented_unsafe_blocks)]
#[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use core::ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not};
#[derive(Copy, Clone, Debug)]
#[repr(transparent)]
pub struct Block(pub(super) __m128i);
impl Block {
#[inline]
pub fn is_empty(self) -> bool {
#[cfg(not(target_feature = "sse4.1"))]
{
self == Self::NONE
}
#[cfg(target_feature = "sse4.1")]
{
unsafe { _mm_test_all_zeros(self.0, self.0) == 1 }
}
}
#[inline]
pub fn andnot(self, other: Self) -> Self {
Self(unsafe { _mm_andnot_si128(other.0, self.0) })
}
}
impl Not for Block {
type Output = Block;
#[inline]
fn not(self) -> Self::Output {
unsafe { Self(_mm_xor_si128(self.0, Self::ALL.0)) }
}
}
impl BitAnd for Block {
type Output = Block;
#[inline]
fn bitand(self, other: Self) -> Self::Output {
unsafe { Self(_mm_and_si128(self.0, other.0)) }
}
}
impl BitAndAssign for Block {
#[inline]
fn bitand_assign(&mut self, other: Self) {
unsafe {
self.0 = _mm_and_si128(self.0, other.0);
}
}
}
impl BitOr for Block {
type Output = Block;
#[inline]
fn bitor(self, other: Self) -> Self::Output {
unsafe { Self(_mm_or_si128(self.0, other.0)) }
}
}
impl BitOrAssign for Block {
#[inline]
fn bitor_assign(&mut self, other: Self) {
unsafe {
self.0 = _mm_or_si128(self.0, other.0);
}
}
}
impl BitXor for Block {
type Output = Block;
#[inline]
fn bitxor(self, other: Self) -> Self::Output {
unsafe { Self(_mm_xor_si128(self.0, other.0)) }
}
}
impl BitXorAssign for Block {
#[inline]
fn bitxor_assign(&mut self, other: Self) {
unsafe { self.0 = _mm_xor_si128(self.0, other.0) }
}
}
impl PartialEq for Block {
#[inline]
fn eq(&self, other: &Self) -> bool {
unsafe {
#[cfg(not(target_feature = "sse4.1"))]
{
_mm_movemask_epi8(_mm_cmpeq_epi8(self.0, other.0)) == 0xffff
}
#[cfg(target_feature = "sse4.1")]
{
let neq = _mm_xor_si128(self.0, other.0);
_mm_test_all_zeros(neq, neq) == 1
}
}
}
}

80
vendor/fixedbitset/src/block/wasm.rs vendored Normal file
View File

@@ -0,0 +1,80 @@
use core::{
arch::wasm32::*,
ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not},
};
#[derive(Copy, Clone, Debug)]
#[repr(transparent)]
pub struct Block(pub(super) v128);
impl Block {
#[inline]
pub fn is_empty(self) -> bool {
!v128_any_true(self.0)
}
#[inline]
pub fn andnot(self, other: Self) -> Self {
Self(v128_andnot(self.0, other.0))
}
}
impl Not for Block {
type Output = Block;
#[inline]
fn not(self) -> Self::Output {
Self(v128_xor(self.0, Self::ALL.0))
}
}
impl BitAnd for Block {
type Output = Block;
#[inline]
fn bitand(self, other: Self) -> Self::Output {
Self(v128_and(self.0, other.0))
}
}
impl BitAndAssign for Block {
#[inline]
fn bitand_assign(&mut self, other: Self) {
self.0 = v128_and(self.0, other.0);
}
}
impl BitOr for Block {
type Output = Block;
#[inline]
fn bitor(self, other: Self) -> Self::Output {
Self(v128_or(self.0, other.0))
}
}
impl BitOrAssign for Block {
#[inline]
fn bitor_assign(&mut self, other: Self) {
self.0 = v128_or(self.0, other.0);
}
}
impl BitXor for Block {
type Output = Block;
#[inline]
fn bitxor(self, other: Self) -> Self::Output {
Self(v128_xor(self.0, other.0))
}
}
impl BitXorAssign for Block {
#[inline]
fn bitxor_assign(&mut self, other: Self) {
self.0 = v128_xor(self.0, other.0)
}
}
impl PartialEq for Block {
#[inline]
fn eq(&self, other: &Self) -> bool {
!v128_any_true(v128_xor(self.0, other.0))
}
}

1711
vendor/fixedbitset/src/lib.rs vendored Normal file

File diff suppressed because it is too large Load Diff

45
vendor/fixedbitset/src/range.rs vendored Normal file
View File

@@ -0,0 +1,45 @@
use core::ops::{Range, RangeFrom, RangeFull, RangeTo};
// Taken from https://github.com/bluss/odds/blob/master/src/range.rs.
/// **IndexRange** is implemented by Rust's built-in range types, produced
/// by range syntax like `..`, `a..`, `..b` or `c..d`.
pub trait IndexRange<T = usize> {
#[inline]
/// Start index (inclusive)
fn start(&self) -> Option<T> {
None
}
#[inline]
/// End index (exclusive)
fn end(&self) -> Option<T> {
None
}
}
impl<T> IndexRange<T> for RangeFull {}
impl<T: Copy> IndexRange<T> for RangeFrom<T> {
#[inline]
fn start(&self) -> Option<T> {
Some(self.start)
}
}
impl<T: Copy> IndexRange<T> for RangeTo<T> {
#[inline]
fn end(&self) -> Option<T> {
Some(self.end)
}
}
impl<T: Copy> IndexRange<T> for Range<T> {
#[inline]
fn start(&self) -> Option<T> {
Some(self.start)
}
#[inline]
fn end(&self) -> Option<T> {
Some(self.end)
}
}

150
vendor/fixedbitset/src/serde_impl.rs vendored Normal file
View File

@@ -0,0 +1,150 @@
#[cfg(not(feature = "std"))]
use core as std;
use crate::{Block, FixedBitSet, BYTES};
use alloc::vec::Vec;
use core::{convert::TryFrom, fmt};
use serde::de::{self, Deserialize, Deserializer, MapAccess, SeqAccess, Visitor};
use serde::ser::{Serialize, SerializeStruct, Serializer};
struct BitSetByteSerializer<'a>(&'a FixedBitSet);
impl Serialize for FixedBitSet {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let mut struct_serializer = serializer.serialize_struct("FixedBitset", 2)?;
struct_serializer.serialize_field("length", &(self.length as u64))?;
struct_serializer.serialize_field("data", &BitSetByteSerializer(self))?;
struct_serializer.end()
}
}
impl<'a> Serialize for BitSetByteSerializer<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let len = self.0.as_slice().len() * BYTES;
// PERF: Figure out a way to do this without allocating.
let mut temp = Vec::with_capacity(len);
for block in self.0.as_slice() {
temp.extend(&block.to_le_bytes());
}
serializer.serialize_bytes(&temp)
}
}
impl<'de> Deserialize<'de> for FixedBitSet {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
enum Field {
Length,
Data,
}
fn bytes_to_data(length: usize, input: &[u8]) -> Vec<Block> {
let block_len = length / BYTES + 1;
let mut data = Vec::with_capacity(block_len);
for chunk in input.chunks(BYTES) {
match <&[u8; BYTES]>::try_from(chunk) {
Ok(bytes) => data.push(usize::from_le_bytes(*bytes)),
Err(_) => {
let mut bytes = [0u8; BYTES];
bytes[0..BYTES].copy_from_slice(chunk);
data.push(usize::from_le_bytes(bytes));
}
}
}
data
}
impl<'de> Deserialize<'de> for Field {
fn deserialize<D>(deserializer: D) -> Result<Field, D::Error>
where
D: Deserializer<'de>,
{
struct FieldVisitor;
impl<'de> Visitor<'de> for FieldVisitor {
type Value = Field;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("`length` or `data`")
}
fn visit_str<E>(self, value: &str) -> Result<Field, E>
where
E: de::Error,
{
match value {
"length" => Ok(Field::Length),
"data" => Ok(Field::Data),
_ => Err(de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(FieldVisitor)
}
}
struct FixedBitSetVisitor;
impl<'de> Visitor<'de> for FixedBitSetVisitor {
type Value = FixedBitSet;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("struct Duration")
}
fn visit_seq<V>(self, mut seq: V) -> Result<FixedBitSet, V::Error>
where
V: SeqAccess<'de>,
{
let length = seq
.next_element()?
.ok_or_else(|| de::Error::invalid_length(0, &self))?;
let data: &[u8] = seq
.next_element()?
.ok_or_else(|| de::Error::invalid_length(1, &self))?;
let data = bytes_to_data(length, data);
Ok(FixedBitSet::with_capacity_and_blocks(length, data))
}
fn visit_map<V>(self, mut map: V) -> Result<FixedBitSet, V::Error>
where
V: MapAccess<'de>,
{
let mut length = None;
let mut temp: Option<&[u8]> = None;
while let Some(key) = map.next_key()? {
match key {
Field::Length => {
if length.is_some() {
return Err(de::Error::duplicate_field("length"));
}
length = Some(map.next_value()?);
}
Field::Data => {
if temp.is_some() {
return Err(de::Error::duplicate_field("data"));
}
temp = Some(map.next_value()?);
}
}
}
let length = length.ok_or_else(|| de::Error::missing_field("length"))?;
let data = temp.ok_or_else(|| de::Error::missing_field("data"))?;
let data = bytes_to_data(length, data);
Ok(FixedBitSet::with_capacity_and_blocks(length, data))
}
}
const FIELDS: &'static [&'static str] = &["length", "data"];
deserializer.deserialize_struct("Duration", FIELDS, FixedBitSetVisitor)
}
}

1313
vendor/fixedbitset/tests/tests.rs vendored Normal file

File diff suppressed because it is too large Load Diff