commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
51e0c36278a7f42e20eca5396f4f3ce18d7c6262
Guillaume Pinot
2017-06-16T11:40:59
update to 0.0.4
diff --git a/Cargo.toml b/Cargo.toml index 33a20bc..6ed0d41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structopt" -version = "0.0.3" +version = "0.0.4" authors = ["Guillaume Pinot <texitoi@texitoi.eu>"] description = "Parse command line argument by defining a struct." documentation ...
1
1
1
483396dc9762927509bc5a9dc415da168f2c6140
Pascal Hertleif
2017-06-16T09:47:40
Remove unneeded lifetime annotation
diff --git a/structopt-derive/src/lib.rs b/structopt-derive/src/lib.rs index 3211679..62a127b 100644 --- a/structopt-derive/src/lib.rs +++ b/structopt-derive/src/lib.rs @@ -172,7 +172,7 @@ fn extract_attrs<'a>(attrs: &'a [Attribute], attr_source: AttrSource) -> Box<Ite Box::new(doc_comments.chain(settings_attrs)) ...
1
1
1
2075ee832806188b47b76bb1bd0b7b7641dbca0c
Pascal Hertleif
2017-06-15T18:14:16
Favor help argument over doc comments This changes the behavior of `from_attr_or_env` (used for clap application settings) to favor the last occurrence of the requested attribute. This is what repeatedly calling the same methods to set field properties does implicitly.
diff --git a/structopt-derive/src/lib.rs b/structopt-derive/src/lib.rs index fbad418..3211679 100644 --- a/structopt-derive/src/lib.rs +++ b/structopt-derive/src/lib.rs @@ -169,20 +169,22 @@ fn extract_attrs<'a>(attrs: &'a [Attribute], attr_source: AttrSource) -> Box<Ite } }); - Box::new(sett...
2
56
3
c66413a0822b81355fddc8c1ffe0d2844c044bca
Pascal Hertleif
2017-06-15T13:18:17
WIP: Allow doc comment to set help text This treats doc comments as `help`/`about` attributes, which may lead to concatenating the original help text with the doc comment.
diff --git a/examples/basic.rs b/examples/basic.rs index 8427c08..4197da5 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -11,23 +11,36 @@ extern crate structopt_derive; use structopt::StructOpt; +/// A basic example #[derive(StructOpt, Debug)] -#[structopt(name = "basic", about = "A basic example")] +#...
2
68
24
6d73942385d9de51f824d871cae6accdd530dcda
Guillaume Pinot
2017-02-10T00:19:16
add travis badge to cargo
diff --git a/Cargo.toml b/Cargo.toml index 6376830..d025beb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ categories = ["command-line-interface"] license = "WTFPL" readme = "README.md" +[badges] +travis-ci = { repository = "TeXitoi/structopt" } + [dependencies] clap = "2.20.1" diff --git a/structop...
2
6
0
72d9c576d3e3c497f03858b016b20d4ce87a3495
Guillaume Pinot
2017-02-10T00:18:47
desactivate doctest on structopt-derive doc
diff --git a/structopt-derive/src/lib.rs b/structopt-derive/src/lib.rs index f23faf2..36e1403 100644 --- a/structopt-derive/src/lib.rs +++ b/structopt-derive/src/lib.rs @@ -9,7 +9,7 @@ //! //! First, look at an example: //! -//! ``` +//! ```ignore //! #[derive(StructOpt)] //! #[structopt(name = "example", about = ...
1
2
2
d3872e09849be9480fdb07229d9eaf954133cf58
Guillaume Pinot
2017-02-09T21:51:41
add example.rs
diff --git a/examples/example.rs b/examples/example.rs new file mode 100644 index 0000000..1788148 --- /dev/null +++ b/examples/example.rs @@ -0,0 +1,38 @@ +// Copyright (c) 2017 Guillaume Pinot <texitoi(a)texitoi.eu> +// +// This work is free. You can redistribute it and/or modify it under +// the terms of the Do What...
1
38
0
e3492f74fa8b03f8ddc61774596e791a4654929f
Guillaume Pinot
2017-02-07T22:34:40
support custom name
diff --git a/examples/basic.rs b/examples/basic.rs index 739e1f2..8427c08 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -27,7 +27,7 @@ struct Opt { #[structopt(short = "l", long = "level")] #[structopt(help = "admin_level to consider")] level: Vec<String>, - #[structopt(help = "Files to pr...
2
31
18
8d095c609ded196f43e24f03341fe5bae6485f48
Guillaume Pinot
2017-02-07T22:03:13
refactor
diff --git a/structopt-derive/src/lib.rs b/structopt-derive/src/lib.rs index d3220b9..9871ced 100644 --- a/structopt-derive/src/lib.rs +++ b/structopt-derive/src/lib.rs @@ -75,16 +75,44 @@ fn from_attr_or(attrs: &[(&Ident, &Lit)], key: &str, default: &str) -> Lit { .find(|&&(i, _)| i.as_ref() == key) ...
1
52
70
b0cf3af9c990c8b2c5468fb04a7b2748e900a760
Guillaume Pinot
2017-02-07T00:52:26
example with args
diff --git a/examples/basic.rs b/examples/basic.rs index aaf68d2..739e1f2 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -27,6 +27,8 @@ struct Opt { #[structopt(short = "l", long = "level")] #[structopt(help = "admin_level to consider")] level: Vec<String>, + #[structopt(help = "Files to pr...
2
3
3
fdc18d07bb1849bf7ca02d748ff8808704edc972
Guillaume Pinot
2017-02-07T00:41:16
add flag tests
diff --git a/Cargo.toml b/Cargo.toml index 7c966b2..55a3943 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,8 @@ readme = "README.md" [dependencies] clap = "2.20.1" + +[dev-dependencies] structopt-derive = { path = "structopt-derive", version = "0.0.0" } [workspace] diff --git a/src/lib.rs b/src/lib.rs in...
4
84
5
4e4bbabfa7f7d1877f6dbb16c7829ef972e2373b
Guillaume Pinot
2017-02-06T23:19:18
manage not require extern crate clap from user
diff --git a/examples/basic.rs b/examples/basic.rs index ec059a5..aaf68d2 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -8,7 +8,6 @@ extern crate structopt; #[macro_use] extern crate structopt_derive; -extern crate clap; use structopt::StructOpt; diff --git a/structopt-derive/src/lib.rs b/structopt-...
2
29
19
afd812cf5a1b94932401b588eb7fc19132f6af9a
Guillaume Pinot
2017-02-06T22:55:46
validator + default value
diff --git a/examples/basic.rs b/examples/basic.rs index dd45c68..ec059a5 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -19,13 +19,14 @@ struct Opt { debug: bool, #[structopt(short = "v", long = "verbose", help = "Verbose mode")] verbose: u64, - #[structopt(short = "s", long = "speed", hel...
2
46
11
edc9d69f030524072645938a566e6c0ca07e47a6
Guillaume Pinot
2017-02-06T00:00:27
support attrs in struct
diff --git a/examples/basic.rs b/examples/basic.rs index 049488e..dd45c68 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -8,12 +8,12 @@ extern crate structopt; #[macro_use] extern crate structopt_derive; -#[macro_use] extern crate clap; use structopt::StructOpt; #[derive(StructOpt, Debug)] +#[struc...
2
38
25
1196571909afa1894558838eef644589a950444a
Guillaume Pinot
2017-02-05T01:06:39
use attributes
diff --git a/examples/basic.rs b/examples/basic.rs index 3b3493f..049488e 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -15,10 +15,17 @@ use structopt::StructOpt; #[derive(StructOpt, Debug)] struct Opt { + #[structopt(short = "d", long = "debug", help = "Activate debug mode")] debug: bool, + ...
2
28
5
36b39727b1c636c65c2205956ecab69fd04d0ae2
Guillaume Pinot
2017-02-04T00:43:44
support different options
diff --git a/examples/basic.rs b/examples/basic.rs index 9016c0f..3b3493f 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -13,12 +13,16 @@ extern crate clap; use structopt::StructOpt; -#[derive(StructOpt, Default)] +#[derive(StructOpt, Debug)] struct Opt { - i: bool, + debug: bool, + verbose: u...
2
103
6
13952b9f2db30fdbe81575a25fb41302264e607e
Luke Parker
2026-04-09T21:08:32
Fix output for 16-bit targets (#1470) `tokens32` being used for both 16 and 32 bits appears to be an artifact from copying the prior block and modifying it (as reasonable for such development), but itself unsound. --- I used the web UI for this, just to fire this off quickly as an exceptionally minor change, but tha...
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 183428c..6589bb0 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -259,7 +259,7 @@ macro_rules! cpubits { // WASM target_arch = "wasm32", ))] - 16 => { $( $tokens32 )* } + 16 => { $...
1
1
1
08f16f27a278d80ded1009b88136bda23a55bce9
Tony Arcieri
2026-04-01T22:34:39
ctutils: add `subtle` migration guide (#1465) Adds a section to the toplevel documentation to assist users who have existing code which uses `subtle` and would like to migrate to `ctutils`. It covers the mappings of the trait/method names and includes various small caveats that can potentially trip one up.
diff --git a/ctutils/src/lib.rs b/ctutils/src/lib.rs index f4e159e..bfa628e 100644 --- a/ctutils/src/lib.rs +++ b/ctutils/src/lib.rs @@ -79,6 +79,45 @@ //! //! This makes it possible to use `ctutils` in a codebase where other dependencies are using //! `subtle`. +//! +//! # [`subtle`] migration guide +//! +//! This ...
1
39
0
7910b5b33c5a249251542881b59d1f4ede48e7fa
Tony Arcieri
2026-03-08T19:13:21
zeroize_derive: make version `*-pre` (#1458) Bumps the version down to v1.5.0-pre so we can bump it in the release PR
diff --git a/Cargo.lock b/Cargo.lock index 7ee40fb..d1dc8a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -733,7 +733,7 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.5.0" +version = "1.5.0-pre" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 4916fee..85...
4
4
3
3cc4e95206b3e56b9d4ea2ef08ba4901a601d819
Artyom Pavlov
2026-02-24T02:02:22
block-buffer: release v0.12.0 (#1456) ### Added - `BlockSizes` trait implemented for sizes bigger than `U0` and smaller than `U256` ([#1455]) ### Changed - Block sizes used by `BlockBuffer` and `ReadBuffer` are now bound by `BlockSizes` ([#1455]) [#1455]: https://github.com/RustCrypto/utils/pull/1455
diff --git a/Cargo.lock b/Cargo.lock index 7cfc17a..7ee40fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c86...
2
256
21
5d2ae1e55d75a01eed9405c003bf9f3a09d10a0f
Tony Arcieri
2026-02-02T00:38:00
cpubits v0.1.0-rc.3 (#1443)
diff --git a/Cargo.lock b/Cargo.lock index 7b22696..3deda45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-rc.2" +version = "0.1.0-rc.3" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 146a4e...
2
2
2
812db06d738fe676545262013ac0d3f23d399270
Tony Arcieri
2026-02-02T00:20:54
cpubits: add 16 vs 32 and 32 vs 64-bit patterns (#1442) For use cases where one of the three sizes won't be supported (either 16-bit or 64-bit), allows matching against only two of the three options
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 78ed49a..183428c 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -197,6 +197,30 @@ macro_rules! cpubits { } }; + // Select between 16-bit and 32-bit options, where no code will be generated for 64-bit targets + ( + 16 =>...
1
25
1
aee59b6006b1a54711b7567672728b201417e0f9
Tony Arcieri
2026-02-01T22:30:14
cpubits v0.1.0-rc.2 (#1441) Adds `cfg(cpubits = "...")`
diff --git a/Cargo.lock b/Cargo.lock index 78062f4..7b22696 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-rc.1" +version = "0.1.0-rc.2" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 46d184...
2
2
2
4e06b95f0a1cb4bbe52259d570130ed2b30708c4
Tony Arcieri
2026-01-28T15:05:22
cpufeatures: add `InitToken::{init, init_get}` (#1435) Makes these methods callable as constructor methods for `InitToken`. This makes for only one thing you have to re-export if you want to provide `InitToken` to other modules within a crate, or potentially as a `pub` re-export as e.g. part of a `hazmat` API.
diff --git a/cpufeatures/src/lib.rs b/cpufeatures/src/lib.rs index d8d4322..df49ad4 100644 --- a/cpufeatures/src/lib.rs +++ b/cpufeatures/src/lib.rs @@ -45,7 +45,17 @@ macro_rules! new { pub struct InitToken(()); impl InitToken { - /// Get initialized value + //...
1
11
1
7eb64064137947952a301eeff63bc7ccd5b4ce63
Tony Arcieri
2026-01-23T18:24:36
cpubits v0.1.0-rc.1 (#1432)
diff --git a/Cargo.lock b/Cargo.lock index 749f96e..78062f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-rc.0" +version = "0.1.0-rc.1" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 2da5d1...
2
2
2
52c96c37f27b2bebf9d916094c1653b9a3c71503
Tony Arcieri
2026-01-23T18:01:42
cpubits: better ARMv7 `cfg` predicate (#1431) We can use the explicit: all(target_arch = "arm", target_feature = "v7") Rather than the previous check for targets that are not thumb: all(target_arch = "arm", not(target_feature = "thumb-mode"))
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 48242f5..5c95f89 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -100,7 +100,7 @@ /// certain targets from 32-bit to 64-bit ones. /// /// This 64-bit promotion occurs if `any` of the following `cfg`s are true: -/// - ARMv7: `all(target_arch = "ar...
1
4
4
a9f3f461baa3e02f69a205c772b6b2d3eac4eda8
Tony Arcieri
2026-01-22T21:38:11
cpubits: vendor the full `cfg_if!` macro (#1429) If we do this, we can potentially drop `cfg-if` as a dependency from crates that use `cpubits`, which would cut down on the impression of the total number of dependencies those crates have.
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 38d2634..48242f5 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -230,11 +230,37 @@ macro_rules! cpubits { }; } -/// Vendored partial copy of the `cfg_if::cfg_if` macro. +/// Vendored copy of the `cfg_if::cfg_if` macro. /// Copyright (c) 20...
1
27
1
27e5257dc4b6985378923a3f4db36766a057b30a
Tony Arcieri
2026-01-22T21:28:44
cpubits: have `enable_64_bits` capture group name match attribute (#1428)
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 3e20c07..38d2634 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -197,7 +197,7 @@ macro_rules! cpubits { // Same API as immediately above, but with a pseudo-attribute we use to pass the `cfg` overrides // for `target_pointer_width` that pr...
1
3
3
c6e4a79d016872d588022874cfbf4f9d99420cfb
Tony Arcieri
2026-01-22T19:48:54
cpubits v0.1.0-rc.0 (#1427)
diff --git a/Cargo.lock b/Cargo.lock index 970c1c0..4bac521 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-pre.4" +version = "0.1.0-rc.0" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 295d5...
2
2
2
f422d50c1eeb0dd3bbc336f0d1b82d095150a0b2
Tony Arcieri
2026-01-21T19:44:21
cpubits: change `cfg(enable_64_bit = ...)` syntax (#1426) The new syntax is used in the title, and feels a little more idiomatic than the old syntax, which was `cfg(enable_64bit(...))`. It's also changed not to be implicitly `any(...)` to feel a little more WYSIWYG, i.e. it now uses an explicit `any` rather than havi...
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 80263c8..3e20c07 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -182,8 +182,7 @@ macro_rules! cpubits { ) => { $crate::cpubits! { // `cfg` selector for 64-bit target overrides - // Implicitly `cfg(any(...))` - ...
1
10
24
9952fcfd29e3143894ccfabb1414d49b1cec489b
Tony Arcieri
2026-01-21T19:22:47
cpubits v0.1.0-pre.4 (#1425)
diff --git a/Cargo.lock b/Cargo.lock index 5276e22..970c1c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-pre.3" +version = "0.1.0-pre.4" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 4be7...
2
2
2
3e6087948c6ed0ba633c2d31bc63a9ad6e67e637
Tony Arcieri
2026-01-21T17:51:43
cpubits: bind a `CPUBITS` constant (#1423) Uses the macro to bind a `u32` constant value representing the number of bits detected by the macro.
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 9aefb13..80263c8 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -278,16 +278,18 @@ macro_rules! cfg_if { }; } +/// Constant representing the detection result from `cpubits!` on the current target. +pub const CPUBITS: u32 = { + cpubits! {...
1
13
11
2c3df3e40d405dd47b1f37347c9764660356dfcc
Tony Arcieri
2026-01-21T17:33:59
cpubits: add expression example (#1422)
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 042602e..9aefb13 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -79,6 +79,21 @@ /// } /// ``` /// +/// ## Use as an expression +/// +/// It's also possible to use the macro as an expression, although in somewhat limited contexts +/// due to its ...
1
15
0
1f2bdb0c50d4d5324bd36ce42bfaf8b8c12aeda6
Tony Arcieri
2026-01-21T05:27:12
cpubits v0.1.0-pre.3 (#1420)
diff --git a/Cargo.lock b/Cargo.lock index 21b77be..5276e22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-pre.2" +version = "0.1.0-pre.3" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index f894...
3
7
4
0c3e384274cb68374272f3e45b3947571ce2cbc9
Tony Arcieri
2026-01-21T02:02:20
clippy: set `needless_range_loop = "allow"` (#1417) These sorts of imperative-style loops are often one of the easiest-to-read solutions to simple problems. I thought I added this to #1411 but I guess it got lost along the way.
diff --git a/Cargo.toml b/Cargo.toml index 5e63600..4c6f7a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,13 +40,14 @@ cast_sign_loss = "warn" checked_conversions = "warn" doc_markdown = "warn" from_iter_instead_of_collect = "warn" +implicit_saturating_sub = "warn" manual_assert = "warn" map_unwrap_or = "warn" ...
3
2
4
7f459a5d942bb42684b5da4e1d089e6dcc4fac33
Nics
2026-01-21T00:59:50
ctutils: add size integers implementations (#1416) - Add `CtGt` and `CtLt` for usize - Add `CtAssign` and `CtSelect` for `NonZero{U,I}size` - Add `CtNeg` for `NonZero{U,I}size` and `{u,i}size` - Add some tests Co-authored-by: Nics <NicsTr@users.noreply.github.com>
diff --git a/ctutils/src/traits/ct_assign.rs b/ctutils/src/traits/ct_assign.rs index 3f55862..5869922 100644 --- a/ctutils/src/traits/ct_assign.rs +++ b/ctutils/src/traits/ct_assign.rs @@ -3,8 +3,8 @@ use cmov::Cmov; use core::{ cmp, num::{ - NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128,...
6
149
46
f5dbf7c62775a3a8143010f8b0ce1e4948d8d8ef
Nics
2026-01-21T00:06:12
cmov: (NonZero){u,i}size improvements (#1415) Implements `Cmov` and `CmovEq` for `NonZeroUsize` and `NonZeroIsize`. Implements slice for size integer types (and their `NonZero*` variants). Co-authored-by: Nics <NicsTr@users.noreply.github.com>
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index dbb5a4f..f50c11e 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -41,8 +41,8 @@ mod slice; use core::{ cmp, num::{ - NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroU8, NonZeroU16, - NonZeroU32, NonZeroU64, NonZeroU12...
2
15
7
29664d08c95432b8e7143a6fdaf6c29346ed8cb4
Tony Arcieri
2026-01-20T23:23:06
cmov: consolidate `allow(clippy::cast_possible_truncation)` attrs (#1413)
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index a56a7be..dbb5a4f 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -220,9 +220,9 @@ macro_rules! impl_cmov_traits_for_size_int { target_pointer_width = "64" ))] #[cfg_attr(docsrs, doc(cfg(true)))] + #[allow(clippy::cast_possi...
1
2
6
61808d5c84ee4adce1a75eb4131f6c80bd3ef891
Nics
2026-01-20T23:05:46
cmov: fix size int implementation of cmovnz (#1412) Current `Cmov` implementation for `usize` and `isize` does nothing since it mutates a temporary value. This commit fixes this and add tests for `usize` and `isize`. I am surprised that there is not a clippy lint that warns about this. Co-authored-by: Nics <NicsTr@...
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index 5dee24b..a56a7be 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -225,21 +225,27 @@ macro_rules! impl_cmov_traits_for_size_int { #[allow(clippy::cast_possible_truncation)] #[inline] fn cmovnz(&mut self, other: &Self, condi...
4
16
5
949537f39833aa5a3b0459227c48b47815178304
Tony Arcieri
2026-01-19T05:17:43
ctutils: add toplevel docs about `CtAssign` trait (#1409)
diff --git a/ctutils/src/lib.rs b/ctutils/src/lib.rs index 4241744..5ecbbb3 100644 --- a/ctutils/src/lib.rs +++ b/ctutils/src/lib.rs @@ -60,6 +60,17 @@ //! something it isn't with `Option`: evaluate combinators eagerly instead of lazily, running the //! same functions regardless of the value's effective presence or a...
1
13
2
0dbac4693aad188d4f22975f6e792065da9bb35b
Tony Arcieri
2026-01-19T05:10:01
ctutils v0.4.0-pre.5 (#1408)
diff --git a/Cargo.lock b/Cargo.lock index 6f44256..e13e73a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,12 +62,6 @@ dependencies = [ "proptest", ] -[[package]] -name = "cmov" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1888fb431ee159b513b5c2f249e03f1c9d78...
2
3
9
1be824b492ffe0e9476e45c79a33ebaba51dc0aa
Tony Arcieri
2026-01-19T04:59:50
ctutils: use new `cmov` trait impls; remove `unsafe` (#1405) In #1404 impls of `Cmov` and `CmovEq` were added to the `NonZero*` and `Ordering` types and slices thereof, which is what the unsafe code in `ctutils` existed to handle. Now they can be handled like the other types `cmov` already has trait impls for. And w...
diff --git a/Cargo.lock b/Cargo.lock index fac5221..6f44256 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,6 +62,12 @@ dependencies = [ "proptest", ] +[[package]] +name = "cmov" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1888fb431ee159b513b5c2f249e03f1c9d78...
6
72
108
5262484ec22d5795940411c4f8e31c082c2e2fe5
Tony Arcieri
2026-01-19T04:09:44
cmov: add support for `NonZero` and `Ordering` (#1404) Adds `Cmov` and `CmovEq` impls for the following types (and slices thereof) from `core::num`: - NonZeroI8 - NonZeroI16 - NonZeroI32 - NonZeroI64 - NonZeroI128 - NonZeroU8 - NonZeroU16 - NonZeroU32 - NonZeroU64 - NonZeroU128 Also adds support to `core::cmp::Order...
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index d15cb5a..5dee24b 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -38,7 +38,19 @@ mod array; mod backends; mod slice; -/// Condition +use core::{ + cmp, + num::{ + NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroU8, NonZeroU16...
3
240
56
3524aa88dd3d0002b09906b43c51fbc91f92e03f
Tony Arcieri
2026-01-19T02:53:15
cpubits v0.1.0-pre.2 (#1402) Now with all possible permutations of a fully explicit syntax
diff --git a/Cargo.lock b/Cargo.lock index c8f557c..b3b48d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-pre.1" +version = "0.1.0-pre.2" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 5737...
2
2
2
b9b4d62437f00e1962f796ca7647343452ddbe47
Tony Arcieri
2026-01-19T02:45:13
cpubits: split toplevel and macro docs (#1403) Makes the toplevel rustdoc give an overview, putting the detailed documentation on the macro itself. That way, if crates re-export the macro, people who click the re-export will go directly to the detailed documentation.
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index 542d543..c0f3c9a 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -17,15 +17,10 @@ //! expected values for `target_pointer_width` are: `16`, `32`, and `64` //! ``` //! -//! # Usage +//! # Example //! -//! Use this macro to run code blocks specifi...
1
72
46
f6ab29c56f7ce379e0a136c88b52eef1b3ee7787
Tony Arcieri
2026-01-19T02:18:06
cpubits: explicit WYSIWYG syntax (#1401) In #1398 I experimented with making some of the syntax implicit, but as soon as it became clear I also needed to add support for ignoring certain bit sizes and only running code on others that quickly became a bad idea. This commit changes the syntax to be fully explicit, like...
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index c1ddeae..542d543 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -5,9 +5,27 @@ html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg" )] +//! # Supported bit sizes +//! +//! This crate supports the followin...
1
70
29
3a1f930b706be629f6b007de31e91b7f4b578381
Tony Arcieri
2026-01-19T01:40:23
cpubits: add 64-bit only gating (#1400) Useful for when things are only possible because the word size is sufficiently large, e.g. `From<u64> for Word`. Also adds some explanatory comments about the various clauses of the macro.
diff --git a/cpubits/src/lib.rs b/cpubits/src/lib.rs index c94093f..c1ddeae 100644 --- a/cpubits/src/lib.rs +++ b/cpubits/src/lib.rs @@ -41,6 +41,7 @@ #[macro_export] macro_rules! cpubits { + // Select between 16-bit and 32-bit, where 64-bit targets will use the 32-bit option ( 16 => { $( $tokens16...
1
18
0
e13fd9ec48aa791a11248b2d287663edad4858f1
Tony Arcieri
2026-01-18T20:21:31
cpubits: shorthand for `|` and more combinations (#1398) - Allows omitting the `16` in `16 | 32` - Adds `16` vs `32 | 64` as an option, where `64` can be omitted
diff --git a/Cargo.lock b/Cargo.lock index d50e91f..c8f557c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.1.0-pre.0" +version = "0.1.0-pre.1" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 2149...
3
46
2
01c012463111e02e2c148e82f0eefe11aae2fce0
Tony Arcieri
2026-01-18T19:14:46
cpubits v0.1.0-pre.0
diff --git a/Cargo.lock b/Cargo.lock index 21f28e7..d50e91f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "0.1.0" [[package]] name = "cpubits" -version = "0.0.0" +version = "0.1.0-pre.0" [[package]] name = "cpufeatures" diff --git a/cpubits/Cargo.toml b/cpubits/Cargo.toml index 89ce137..2...
2
2
2
953407aa207683123c02337af6e05bf04507fe5d
Tony Arcieri
2026-01-18T16:31:03
ctutils: replace `[T]: ...` bounds with `T: *Slice` (#1395) This should make it clearer to users which traits their types need to impl to be valid for the bounds, rather than indirectly relying on the blanket impl of `*Slice` traits for `[T]`.
diff --git a/ctutils/src/traits/ct_assign.rs b/ctutils/src/traits/ct_assign.rs index 5f757bd..7f3a327 100644 --- a/ctutils/src/traits/ct_assign.rs +++ b/ctutils/src/traits/ct_assign.rs @@ -123,7 +123,7 @@ impl_ct_assign_with_ct_select!( impl<T, const N: usize> CtAssign for [T; N] where - [T]: CtAssign, + T: C...
3
17
23
f636ed7001667cb64f82f668eebfeeeaeadfa287
Tony Arcieri
2026-01-18T06:28:26
ctutils: add `*Slice` trait impls to `Choice`/`CtOption` (#1394) Adds impls of `CtAssignSlice` and `CtEqSlice` to the `Choice` and `CtOption` types.
diff --git a/ctutils/src/choice.rs b/ctutils/src/choice.rs index 255c746..0700da3 100644 --- a/ctutils/src/choice.rs +++ b/ctutils/src/choice.rs @@ -1,6 +1,9 @@ -use crate::{CtAssign, CtEq, CtSelect}; +use crate::{CtAssign, CtAssignSlice, CtEq, CtEqSlice, CtSelectUsingCtAssign}; use core::ops::{BitAnd, BitAndAssign, B...
2
15
12
c8e53edff439e435b4b6d3cc76c56a5d4ec8438d
Tony Arcieri
2026-01-18T06:17:50
ctutils: group `alloc`-dependent impls under `alloc` submodules (#1393) Gets rid of repetitive `#[cfg(feature = "alloc")]` gating by putting all of the gated functionality for a given module under a `mod alloc` submodule.
diff --git a/ctutils/src/traits/ct_assign.rs b/ctutils/src/traits/ct_assign.rs index d315c47..5f757bd 100644 --- a/ctutils/src/traits/ct_assign.rs +++ b/ctutils/src/traits/ct_assign.rs @@ -8,9 +8,6 @@ use core::{ }, }; -#[cfg(feature = "alloc")] -use alloc::{boxed::Box, vec::Vec}; - #[cfg(doc)] use core::num:...
5
183
183
947ecd0ede52f5d794b2ce39af113b0b201c6135
Tony Arcieri
2026-01-18T05:43:37
ctutils v0.4.0-pre.4 (#1392)
diff --git a/Cargo.lock b/Cargo.lock index 27f8aea..e4a44d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.0-pre.3" +version = "0.4.0-pre.4" dependencies = [ "cmov", "proptest", diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index ...
2
2
2
6e30036719ec22231665cdf5ac4d5573369cbab2
Tony Arcieri
2026-01-18T05:35:47
ctutils: add `CtSelectUsingCtAssign` (#1391) Adds a marker trait bounded on `Clone + CtAssign` which writes a blanket impl of `CtSelect` by cloning `self` and then performing `CtAssign`. The blanket impl is used to replace all of the repeat occurrences in this crate alone, including the `impl_ct_select_with_ct_assign...
diff --git a/ctutils/src/lib.rs b/ctutils/src/lib.rs index 8170e40..3c11a82 100644 --- a/ctutils/src/lib.rs +++ b/ctutils/src/lib.rs @@ -110,5 +110,5 @@ pub use traits::{ ct_lookup::CtLookup, ct_lt::CtLt, ct_neg::CtNeg, - ct_select::{CtSelect, CtSelectArray}, + ct_select::{CtSelect, CtSelectArray, ...
3
23
56
8d776bd22c81b3128f58f2a8e0dc8ff28d426635
Tony Arcieri
2026-01-18T04:23:52
ctutils v0.4.0-pre.3 (#1390)
diff --git a/Cargo.lock b/Cargo.lock index d02d564..27f8aea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.0-pre.2" +version = "0.4.0-pre.3" dependencies = [ "cmov", "proptest", diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index ...
4
4
4
b2e7cef030c3b5265d5b114f92b5151f971233cd
Tony Arcieri
2026-01-18T04:16:12
ctutils: remove `target_pointer_width` gating (#1389) From #1387, via rustc itself: expected values for `target_pointer_width` are: `16`, `32`, and `64` So these impls should actually be ubiquitously available, for now. If we remove the gating in this crate, then all we need to do to handle new pointer widths i...
diff --git a/ctutils/src/traits/ct_lookup.rs b/ctutils/src/traits/ct_lookup.rs index 5c3db84..0bbecca 100644 --- a/ctutils/src/traits/ct_lookup.rs +++ b/ctutils/src/traits/ct_lookup.rs @@ -99,8 +99,6 @@ mod tests { assert!(EXAMPLE.ct_lookup(4u32).is_none().to_bool()); } - // usize only ha...
2
3
37
b5d28ce132f16f8746f6ba000959783323b5cfba
Tony Arcieri
2026-01-18T03:55:09
ctutils: pluggable trait impls for `[T]` and `[T; N]` (#1388) Introduces a set of helper traits for the following: - `CtAssign`: `CtAssignSlice` - `CtEq`: `CtEqSlice` - `CtSelect`: `CtSelectArray` Implementing a `*Slice` trait unlocks a blanket impl for the corresponding trait for `[T]`, e.g. impl'ing `CtAssignSlice...
diff --git a/ctutils/src/array.rs b/ctutils/src/array.rs deleted file mode 100644 index 47c5236..0000000 --- a/ctutils/src/array.rs +++ /dev/null @@ -1,91 +0,0 @@ -//! Array helpers: generic selection/equality operations for arrays. -//! -//! Use these in the event there isn't an impl of a given trait for `[T; N]`. If ...
6
209
266
14621c57a5185f778fc54d38421c1d2365ccee80
Tony Arcieri
2026-01-18T03:48:25
cmov: mark `isize`/`usize` impls of `Cmov(Eq)` as always available (#1387) Via rustc itself: expected values for `target_pointer_width` are: `16`, `32`, and `64` This adds a `doc(cfg(true))` attribute to the impls for `isize` and `usize` to hide the `cfg` gating so it doesn't show up in the rustdoc, but it's sti...
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index 3c02bd7..d15cb5a 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -201,14 +201,17 @@ macro_rules! impl_cmov_traits_for_size_type { target_pointer_width = "32", target_pointer_width = "64" ))] + #[cfg_attr(docsrs, doc(cfg...
1
6
0
a42c881872f09563a7521959bddbab7357a59de3
Tony Arcieri
2026-01-18T00:48:03
ctutils v0.4.0-pre.2 (#1385)
diff --git a/Cargo.lock b/Cargo.lock index fd377aa..b52d70d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.0-pre.1" +version = "0.4.0-pre.2" dependencies = [ "cmov", "proptest", diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index ...
2
2
2
d4a2ff687f0f607e64ab1b3a56c1ff8b9ec003d2
Tony Arcieri
2026-01-18T00:36:35
ctutils: additional clippy lints (#1384) Enables the following and fixes violations if any: - `clippy::borrow_as_ptr` - `clippy::must_use_candidate` - `clippy::ref_as_ptr` - `clippy::semicolon_if_nothing_returned` - `clippy::unwrap_in_result`
diff --git a/ctutils/src/choice.rs b/ctutils/src/choice.rs index c2bfb78..255c746 100644 --- a/ctutils/src/choice.rs +++ b/ctutils/src/choice.rs @@ -104,6 +104,7 @@ impl Choice { /// Returns [`Choice::TRUE`] if `x == y`, and [`Choice::FALSE`] otherwise. #[inline] + #[must_use] pub const fn from_i64_...
5
50
5
a10fe63924bdb57922edc371b8f44325cc1cc3bb
Tony Arcieri
2026-01-18T00:24:16
cmov: additional clippy lints (#1383) Enables the following and fixes violations if any: - `clippy::ref_as_ptr` - `clippy::return_self_not_must_use` - `clippy::semicolon_if_nothing_returned`
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index 3fde4fd..3c02bd7 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -15,6 +15,9 @@ clippy::mod_module_files, clippy::panic, clippy::panic_in_result_fn, + clippy::ref_as_ptr, + clippy::return_self_not_must_use, + clippy::semicolon_if_nothing...
2
9
6
f1dfe410445c23f45ae1f832e5fc586345e793c4
Tony Arcieri
2026-01-18T00:10:17
ctutils: add missing `#[must_use]` attributes (#1382) I ran into a bug `#[must_use]` would've caught and noticed we could use it all over the place. Fortunately, it can be detected and applied automatically with clippy.
diff --git a/ctutils/src/array.rs b/ctutils/src/array.rs index 2225cf5..47c5236 100644 --- a/ctutils/src/array.rs +++ b/ctutils/src/array.rs @@ -23,6 +23,7 @@ where /// Generic implementation of constant-time equality testing for arrays which works with any type /// which impls `CtEq`. Useful in the event there isn't...
12
47
2
a7fc3671c935d891ee37373db5a9ca2bd089811b
Tony Arcieri
2026-01-17T22:35:57
cmov: simplify slice casts (#1381) We can cast them directly, rather than reconstructing them
diff --git a/cmov/src/slice.rs b/cmov/src/slice.rs index 1dbf85c..36ae0ba 100644 --- a/cmov/src/slice.rs +++ b/cmov/src/slice.rs @@ -255,10 +255,9 @@ impl_cmoveq_with_loop!(u16, u32, u64, u128); /// Performs an unsafe pointer cast from one slice type to the other. /// -/// # Panics +/// # Compile-time panics /// -...
1
14
12
ec3843741572835d7e9626e40ec2316553f7de1a
Tony Arcieri
2026-01-17T20:13:44
cmov: slice cleanups (#1379) - Simplify and clean up macros - Get rid of 32-bit impls until we can benchmark them and show they actually improve performance (less complexity for now) - Get rid of rustdoc on `Cmov`/`CmovEq` impl blocks: it varies by platform (so docs.rs will show how it works on `x86_64`) and really it...
diff --git a/cmov/src/array.rs b/cmov/src/array.rs index 74686eb..a061d1b 100644 --- a/cmov/src/array.rs +++ b/cmov/src/array.rs @@ -4,8 +4,8 @@ use crate::{Cmov, CmovEq, Condition}; -/// Optimized implementation for byte arrays which coalesces them into word-sized chunks first, -/// then performs [`Cmov`] at the ...
2
107
175
7c9ca7bfdf2f884ef9c938492c130db8d2845a7e
Tony Arcieri
2026-01-17T19:13:22
cmov: improve slice remainder handling (#1377) When chunking slices into words, instead of handling the remainder by iterating over it an element at a time, converts the remainder into a `Word` and applies either `Cmov` or `CmovEq` to the word. For `Cmov`, the computed `Word` is used to fill `dst_remainder`. The imp...
diff --git a/cmov/src/slice.rs b/cmov/src/slice.rs index 8a52b58..3b9b7c0 100644 --- a/cmov/src/slice.rs +++ b/cmov/src/slice.rs @@ -1,7 +1,10 @@ //! Trait impls for core slices. use crate::{Cmov, CmovEq, Condition}; -use core::slice; +use core::{ + ops::{BitOrAssign, Shl}, + slice, +}; // Uses 64-bit word...
1
127
20
bb30a74c959addb5c2fedee9cc790569bd6cfe44
Tony Arcieri
2026-01-17T16:23:27
ctutils: delegate `CtAssign`/`CtEq` for `[T]` to `cmov` (#1376) `cmov` now contains optimized implementations of its `Cmov` and `CmovEq` traits for the following slice types: - `[i8]`, `[i16]`, `[i32]`, `[i64]`, `[i128]` - `[u8]`, `[u16]`, `[u32]`, `[u64]`, `[u128]` These impls coalesce the inputs into word-size chu...
diff --git a/ctutils/src/array.rs b/ctutils/src/array.rs new file mode 100644 index 0000000..2225cf5 --- /dev/null +++ b/ctutils/src/array.rs @@ -0,0 +1,89 @@ +//! Array helpers: generic selection/equality operations for arrays. +//! +//! Use these in the event there isn't an impl of a given trait for `[T; N]`. If ther...
10
267
333
eaeb3317b63185e2d8d5852617614011c8dedf5a
Tony Arcieri
2026-01-17T15:05:47
cmov: impl `Cmov`/`CmovEq` for `isize`/`usize` (#1375)
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index 6e79ea0..3fde4fd 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -153,7 +153,7 @@ impl CmovEq for u128 { } } -// Impl `Cmov*` by first casting to unsigned then using the unsigned `Cmov` impls +/// Impl `Cmov*` by first casting to unsigned then using the...
1
60
1
5a0133e7379bad6d79cf7679b238cb1d21f02261
Tony Arcieri
2026-01-17T05:13:40
cmov v0.5.0-pre.1 (#1374) Includes expanded trait impls for more core integers
diff --git a/Cargo.lock b/Cargo.lock index 8030787..05ab9e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,7 +57,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cmov" -version = "0.5.0-pre.0" +version = "0.5.0-pre.1" dependencies = [ "proptest", ] diff --g...
2
2
2
db217a74a745164273fb1ed84af7104e7a64bf59
Tony Arcieri
2026-01-17T05:06:01
cmov: impl `Cmov`/`CmovEq` for slices of signed integers (#1373) Adds impls of both traits for the following: - `[i8]` - `[i16]` - `[i32]` - `[i64]` - `[i128]` The impls cast to the corresponding unsigned integer of the same size, then invoke the corresponding trait impl on that type.
diff --git a/cmov/src/slice.rs b/cmov/src/slice.rs index 08f4ac9..8a52b58 100644 --- a/cmov/src/slice.rs +++ b/cmov/src/slice.rs @@ -198,6 +198,107 @@ impl_cmov_with_loop!( "Implementation for `u128` slices where we can just loop." ); +macro_rules! assert_size_and_alignment_eq { + ($signed:ty, $unsigned:ty) ...
2
107
1
b054a279cc3f468d6d2a86c77964d20798541a5b
Tony Arcieri
2026-01-17T04:36:29
cmov: expand slice impls and tests (#1372) - Expands `CmovEq` impls to slices of all unsigned core integer types - Expands tests for both `Cmov` and `CmovEq` impls that cover slices of all core integer types - Makes impls of `Cmov` and `CmovEq` for `[T; N]` generic around when the corresponding slice type `[T]` impls ...
diff --git a/cmov/src/array.rs b/cmov/src/array.rs index 0459614..74686eb 100644 --- a/cmov/src/array.rs +++ b/cmov/src/array.rs @@ -1,10 +1,15 @@ //! Trait impls for core arrays. +//! +//! Implemented generically, delegating to the slice impls. use crate::{Cmov, CmovEq, Condition}; /// Optimized implementation ...
3
143
81
9985bd69d95061348ba6fd78f9aa619864eed525
Tony Arcieri
2026-01-17T03:50:30
cmov: add `doc(cfg(true))` to backend trait impls (#1371) This ensures that they show up as always available in the rustdoc rendered on docs.rs, as opposed to appearing with target/feature gates that don't actually exist
diff --git a/cmov/Cargo.toml b/cmov/Cargo.toml index fe672c4..44ada2f 100644 --- a/cmov/Cargo.toml +++ b/cmov/Cargo.toml @@ -18,3 +18,6 @@ instructions on x86/x86_64 and CSEL on AArch64, along with a portable "best-effo [dev-dependencies] proptest = "1.9" + +[package.metadata.docs.rs] +all-features = true diff --gi...
4
28
5
eabe93454ad05e20baab78cdde3044bdffc595c2
Tony Arcieri
2026-01-17T03:30:56
cmov: expand slice impls to all unsigned integers (#1370) Includes specialized impls for `u16` and `u32` that coalesce to the word size to improve performance when operating over slices.
diff --git a/cmov/src/array.rs b/cmov/src/array.rs index 63fc869..0459614 100644 --- a/cmov/src/array.rs +++ b/cmov/src/array.rs @@ -1,15 +1,13 @@ //! Trait impls for core arrays. -use crate::{Cmov, CmovEq, Condition, slice::cmovnz_slice_unchecked}; +use crate::{Cmov, CmovEq, Condition}; /// Optimized implementat...
3
177
33
2a8b0b1728eb6f6c8c9160b04b7194d9124c76da
Tony Arcieri
2026-01-17T01:35:23
ctutils: `core::num::NonZero<T>` support (#1368) Adds initial support for the following aliases of `NonZero<T>`: - NonZeroI8 - NonZeroI16 - NonZeroI32 - NonZeroI64 - NonZeroI128 - NonZeroU8 - NonZeroU16 - NonZeroU32 - NonZeroU64 - NonZeroU128 (We can't yet implement things generically because `NonZero` bounds on `T:...
diff --git a/ctutils/src/lib.rs b/ctutils/src/lib.rs index 58e0823..0306260 100644 --- a/ctutils/src/lib.rs +++ b/ctutils/src/lib.rs @@ -17,6 +17,8 @@ clippy::panic_in_result_fn, clippy::std_instead_of_alloc, clippy::std_instead_of_core, + clippy::undocumented_unsafe_blocks, + clippy::unnecessary_s...
7
176
7
2dab4bc9360131539422e03dc51e10fc1973671a
Tony Arcieri
2026-01-16T23:26:52
ctutils: `CtAssign` <=> `CtSelect` delegating macros (#1366) Adds/adapts and exports macros for writing impls of `CtSelect` based on `CtAssign` and vice versa: - `impl_ct_assign_with_ct_select!` - `impl_ct_select_with_ct_assign!` The latter already existed as an internal implementation detail of `ct_select`, but thi...
diff --git a/ctutils/src/traits/ct_assign.rs b/ctutils/src/traits/ct_assign.rs index 448a51a..b7cb97e 100644 --- a/ctutils/src/traits/ct_assign.rs +++ b/ctutils/src/traits/ct_assign.rs @@ -8,7 +8,27 @@ pub trait CtAssign { fn ct_assign(&mut self, other: &Self, choice: Choice); } -// Impl `CtAssign` using the `c...
2
29
10
352a72c9b1d86ec42a9e03d0360c26349ec39fa0
Tony Arcieri
2026-01-16T23:03:31
cmov: docs fix: array => slice
diff --git a/cmov/src/slice.rs b/cmov/src/slice.rs index 89b9553..88a7038 100644 --- a/cmov/src/slice.rs +++ b/cmov/src/slice.rs @@ -32,7 +32,7 @@ impl Cmov for [u8] { } } -/// Optimized implementation for byte arrays which coalesces them into word-sized chunks first, +/// Optimized implementation for byte slic...
1
1
1
39e210154bc3cf01165d4a18d380279f39de5e09
Tony Arcieri
2026-01-16T23:01:52
ctutils v0.4.0-pre.0 (#1365)
diff --git a/Cargo.lock b/Cargo.lock index 635a25f..8030787 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.0-pre" +version = "0.4.0-pre.0" dependencies = [ "cmov", "proptest", diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index cc...
2
2
2
2fc06e6fa4df1ab31c161a17fdcb281fc55be88d
Tony Arcieri
2026-01-16T22:51:20
ctutils: enforce `Bytes*` trait usage at compile-time (#1364) The `Bytes*` traits exist because we don't have specialization[1] and the generic implementation of these traits for `[T]` and `[T; N]` will operate a byte-at-a-time on byte slices and byte arrays, when efficient implementations from the `cmov` crate can in...
diff --git a/ctutils/src/traits/ct_assign.rs b/ctutils/src/traits/ct_assign.rs index 7d868c9..448a51a 100644 --- a/ctutils/src/traits/ct_assign.rs +++ b/ctutils/src/traits/ct_assign.rs @@ -70,6 +70,13 @@ where #[inline] #[track_caller] fn ct_assign(&mut self, other: &Self, choice: Choice) { + cons...
3
33
0
450a85b829ab86d81d4db13a3426b109878c137a
Tony Arcieri
2026-01-16T22:37:47
ctutils: split `CtAssign` out of `CtSelect` [BREAKING] (#1363) Note: version bumped to v0.4.0-pre to denote breaking change (not for release) Extracts the `ct_assign` method into its own trait. The main advantage of this is the `CtSelect` trait requires a `Sized` bound, where an independent `CtAssign` trait does not,...
diff --git a/Cargo.lock b/Cargo.lock index 00a0163..635a25f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.3.2" +version = "0.4.0-pre" dependencies = [ "cmov", "proptest", diff --git a/cmov/src/slice.rs b/cmov/src/slice.rs index a4b10a4..8...
12
198
45
513a1a551509ebc6a04bb107bdb2d663edd10fcb
Tony Arcieri
2026-01-16T21:10:25
ctutils: add `CtFind` trait (#1361) Adds a trait with a similar shape to the `Iterator::find` method, which returns the first item in a collection that matches a given predicate. The trait is impl'd for `[T; N] and `[T]` where `T: CtSelect + Default`. This also adds a helper method used in the implementation `CtOpti...
diff --git a/ctutils/src/ct_option.rs b/ctutils/src/ct_option.rs index 3cbc32e..a633bbd 100644 --- a/ctutils/src/ct_option.rs +++ b/ctutils/src/ct_option.rs @@ -150,6 +150,24 @@ impl<T> CtOption<T> { self.as_inner_unchecked() } + /// Inserts `value` into the [`CtOption`], then returns a mutable refer...
4
135
1
1658a0f02c6fa546e0f5d03a9855fe63ea70d3d4
Tony Arcieri
2026-01-16T20:23:54
ctutils: add `BytesCtEq` and `BytesCtSelect` traits (#1359) The generic implementations of `CtEq` and `CtSelect` for `[T]` and `[T; N]` are suboptimal for `[u8]` and `[u8; N]`, where there are now optimized implementations in the `cmov` crate that perform operations on such types a word-at-a-time instead of a byte-at-...
diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index 76915c4..b701970 100644 --- a/ctutils/Cargo.toml +++ b/ctutils/Cargo.toml @@ -17,7 +17,7 @@ edition = "2024" rust-version = "1.85" [dependencies] -cmov = "0.5.0-pre.0" +cmov = "=0.5.0-pre.0" # optional dependencies subtle = { version = "2", optional = t...
4
161
3
5038c79ca3a82e21dd6d28e358dfbe46ac5fce9b
Tony Arcieri
2026-01-16T19:12:07
cmov: extract `backends` module (#1358) Now that we have some additional modules like `array` and `slice` which aren't backends, it makes sense to group all the backends as submodules under a `backends` module for the purposes of code hygeine.
diff --git a/cmov/src/backends.rs b/cmov/src/backends.rs new file mode 100644 index 0000000..decaf15 --- /dev/null +++ b/cmov/src/backends.rs @@ -0,0 +1,17 @@ +//! Backends for `cmov`, only one of which will be selected at compile-time. + +// Architecture-specific backends for target architectures with native predicati...
5
19
12
17f5eb01449c8a3ca8b10b873c5228ccee0d5d6b
Tony Arcieri
2026-01-16T18:55:52
cmov v0.5.0-pre.0 (#1357) Includes breaking optimized version of `CmovEq` for `[u8]`, a pretty important use case
diff --git a/Cargo.lock b/Cargo.lock index 6f1988c..3020454 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,7 +57,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cmov" -version = "0.5.0-pre" +version = "0.5.0-pre.0" dependencies = [ "proptest", ] diff --git...
3
3
3
db238d8ab9ef7eb2f29e2450341cf25bb5fec939
Tony Arcieri
2026-01-16T01:45:01
cmov: impl `Cmov` for `[u8]` (#1354) Adapts the implementation written for core arrays in #1350/#1351 to work on byte slices as well, since there's no reason it couldn't in a code-identical manner. The `[u8; N]` impl now invokes the `[u8]` impl (hopefully inlining can take advantage of knowledge of static `N`). Unfor...
diff --git a/cmov/src/array.rs b/cmov/src/array.rs index 3fdcadb..5996c5d 100644 --- a/cmov/src/array.rs +++ b/cmov/src/array.rs @@ -1,41 +1,21 @@ +//! Trait impls for core arrays. + use crate::{ Cmov, CmovEq, Condition, - utils::{slice_as_chunks, slice_as_chunks_mut}, + utils::{WORD_SIZE, Word, slice_as_ch...
4
57
42
46a43fb13b4531547798b78ba9090b9c3479ccf6
Tony Arcieri
2026-01-16T01:00:23
cmov: impl `CmovEq` for `[u8; N]` (#1353) Similar to the `Cmov` implementation added in #1350, this adds a `CmovEq` implementation for `[u8; N]` which breaks the byte slice up into word-sized chunks, interprets them as a native word integer type (either `u32` or `u64` ala #1350), then calls into the `CmovEq` for that ...
diff --git a/cmov/src/array.rs b/cmov/src/array.rs new file mode 100644 index 0000000..3fdcadb --- /dev/null +++ b/cmov/src/array.rs @@ -0,0 +1,55 @@ +use crate::{ + Cmov, CmovEq, Condition, + utils::{slice_as_chunks, slice_as_chunks_mut}, +}; + +// Uses 64-bit words on 64-bit targets, 32-bit everywhere else +#[c...
5
244
125
f2a5213bc0d6bb3818061b56f86e1565c029dda5
Tony Arcieri
2026-01-15T23:20:12
cmov: fix provided `Cmov::cmovz` impl (#1351) We didn't notice it was broken because all of the impls for all of the core types in the crate explicitly write both methods. However, #1350 just impl'd `Cmov` for `[u8; N]` and didn't have an impl of `cmovz` because the `cmovnz` impl is non-trivial and ideally we could j...
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index ce6901d..f6272bb 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -27,6 +27,9 @@ unused_qualifications )] +#[macro_use] +mod macros; + #[cfg(not(miri))] #[cfg(target_arch = "aarch64")] mod aarch64; @@ -57,7 +60,8 @@ pub trait Cmov { /// equal to ...
4
78
7
ac50346ec864791e374fd1af62ab77d68ba7f46a
Tony Arcieri
2026-01-15T19:56:55
cmov: reorder impl blocks: `Cmov` then `CmovEq` (#1349) Similar change to #1344, first doing all the impls of `Cmov`, then moving on to the impls of `CmovEq`, rather than alternating them for each core unsigned integer type.
diff --git a/cmov/src/aarch64.rs b/cmov/src/aarch64.rs index fb322ae..68c503b 100644 --- a/cmov/src/aarch64.rs +++ b/cmov/src/aarch64.rs @@ -98,31 +98,31 @@ impl Cmov for u16 { } } -impl CmovEq for u16 { +impl Cmov for u32 { #[inline] - fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Conditi...
3
76
76
2fcad3c813e8eb705dfac58db28b0067311f3c76
Tony Arcieri
2026-01-15T17:06:39
cmov: separate in/out in ARM32 ASM (#1346) Changes the `asm!` block used to implement `masknz32` for ARM32 in the (otherwise) portable backend to separate its inputs and outputs, which should be semantically clearer.
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index b9de4b8..98f3939 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -138,12 +138,13 @@ fn masknz64(condition: u64) -> u64 { /// assembly should guarantee won't happen again in the future (CVE-2026-23519). #[cfg(target_arch = "arm")] fn maskn...
1
4
3
b3a22ad4cb64ffa6839e775b19445db4a7327b79
Tony Arcieri
2026-01-15T16:16:04
cmov: impl `Cmov(Eq)` for `u16` using masking (#1345) Uses the same strategy as the `u32` and `u64` impls, but: - For `Cmov`, uses `masknz32` to compute mask, then truncates to `u16` - For `CmovEq`, XORs the inputs, widens to 32-bits, and calls the `maskne32`/`maskeq32` functions like the 32-bit impl, where both then...
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index 547ffc8..b9de4b8 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -1,28 +1,25 @@ -//! Portable "best effort" implementation of `Cmov`. +//! Portable "best effort" implementation of `Cmov`/`CmovEq`. //! -//! This implementation is based on po...
1
27
23
ced2f2aa12023549ffa6acd6c903432c318d4e96
Tony Arcieri
2026-01-15T15:56:20
cmov: group impl blocks by trait in portable backend (#1344) Orders the impls so the `Cmov` impls for `u16`, `u32`, and `u64` come first, followed by the respective `CmovEq` impls.
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index a0f2f2c..547ffc8 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -26,52 +26,52 @@ impl Cmov for u16 { } } -// Uses `CmovEq` impl for `u32` -impl CmovEq for u16 { +impl Cmov for u32 { #[inline] - fn cmovne(&self, rhs: &Self, i...
1
21
17
65f1aec7afb70c672cd313c7ef793b54d61dd4dc
Tony Arcieri
2026-01-15T15:42:13
cmov: use `masksel` to impl `CmovEq` (#1343) Uses the `masksel` function added in #1342 to impl `CmovEq`. This should be less circuitious than the previous implementation. This approach means we can get rid of all of the `test*` functions like `testeq*`, `testne*`, and `testnz*` and implement everything in terms of m...
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index fc27be2..a0f2f2c 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -54,12 +54,12 @@ impl Cmov for u32 { impl CmovEq for u32 { #[inline] fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) { - output.cmovnz(...
1
91
98
b53e6bff21af4cf5ffa59a29a8a9ff82e1061707
Tony Arcieri
2026-01-15T15:20:12
cmov: add generic `masksel` function to `portable` backend (#1342) Generically implements selecting between two values based upon a provided mask value, rather than duplicating this logic
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index 6cdf753..fc27be2 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -7,7 +7,9 @@ //! optimizer potentially inserting branches. use crate::{Cmov, CmovEq, Condition}; +use core::ops::{BitAnd, BitOr, Not}; +// Uses `Cmov` impl for `u32` imp...
1
87
65
b87f17c475117e48285e9301b5b06b57cfa8ce2d
Tony Arcieri
2026-01-15T06:10:20
cmov: clippy fixups for portable backend (#1341) These weren't being detected/applied since clippy runs on x86. Maybe we need `cfg` to override the backend.
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index 19d6bd8..7d35d2c 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -10,29 +10,29 @@ use crate::{Cmov, CmovEq, Condition}; impl Cmov for u16 { #[inline] - fn cmovnz(&mut self, value: &Self, condition: Condition) { - let mut tm...
1
14
14
8b33b635a8aa34a7f6b805e8212fcffb1d19e47f
Tony Arcieri
2026-01-15T06:00:15
cmov: extract portable `testeq*` and `testne*` functions (#1340) More small functions that are good candidates for optimized assembly implementations
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index cfc02b8..19d6bd8 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -53,14 +53,14 @@ impl Cmov for u32 { impl CmovEq for u32 { #[inline] fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) { - let ne = testn...
1
78
14
66db811a4d8447bc2804b3cb5c7321b51ad7502d
Tony Arcieri
2026-01-15T05:23:44
cmov: eliminate macros from portable backend (#1339) Replaces them with simple one-line functions, which are duplicated for 32-bit and 64-bit, but they're simple enough the duplication may not be worth plastering over with macros.
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index 3d65871..cfc02b8 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -8,13 +8,6 @@ use crate::{Cmov, CmovEq, Condition}; -/// Bitwise non-zero: returns `1` if `x != 0`, and otherwise returns `0`. -macro_rules! bitnz { - ($value:expr, $bi...
1
41
32
733d149431958d213cc78223e29e1ec1c7a94ca8
Tony Arcieri
2026-01-15T04:37:23
cmov: explicitly bind XOR output in portable `CmovEq` (#1337) The `bitnz!` macro references its input value twice, so this more explicitly binds it to a local variable first. It's probably nothing LLVM's optimizer can't figure out, but this is more explicit.
diff --git a/cmov/src/portable.rs b/cmov/src/portable.rs index 4a81aca..3d65871 100644 --- a/cmov/src/portable.rs +++ b/cmov/src/portable.rs @@ -1,10 +1,10 @@ //! Portable "best effort" implementation of `Cmov`. //! -//! This implementation is based on portable bitwise arithmetic but cannot -//! guarantee that the re...
1
13
9
5c460375b05ddd9a12709135a81672dd58160b4d
Scott Sanderson
2026-01-04T04:05:33
zeroize: support unsized types in Zeroizing (#1318) This commit adds `?Sized` to the generic bounds on Zeroizing and many of its trait implementations. This makes it possible to form and use types like `Zeroizing<Box<[u8]>>` and `Zeroizing<Arc<[u8]>>`. This also allows forming more exotic types like `Zeroizing<dyn So...
diff --git a/zeroize/src/lib.rs b/zeroize/src/lib.rs index e2662c2..0a45216 100644 --- a/zeroize/src/lib.rs +++ b/zeroize/src/lib.rs @@ -626,7 +626,7 @@ impl Zeroize for CString { /// guaranteed to have the same physical representation as the underlying type. #[derive(Debug, Default, Eq, PartialEq)] #[repr(transpare...
2
98
9
e264242c4e4265611224b227a51b878b51372beb
Tony Arcieri
2026-01-03T23:18:11
ctutils: expand clippy lints (#1329)
diff --git a/cmov/src/lib.rs b/cmov/src/lib.rs index 404f3ce..b63bb9c 100644 --- a/cmov/src/lib.rs +++ b/cmov/src/lib.rs @@ -17,6 +17,7 @@ clippy::std_instead_of_alloc, clippy::std_instead_of_core, clippy::unwrap_used, + missing_copy_implementations, missing_debug_implementations, missing_do...
4
17
3
a33cdd0c06478b3e58615b4c234dc8143b2466db
Tony Arcieri
2026-01-03T22:54:46
cmov: expand clippy lints (#1328)
diff --git a/cmov/src/aarch64.rs b/cmov/src/aarch64.rs index 4683e10..fb322ae 100644 --- a/cmov/src/aarch64.rs +++ b/cmov/src/aarch64.rs @@ -21,7 +21,8 @@ macro_rules! csel { /// Conditional select-based equality test macro_rules! cseleq { ($eor:expr, $cmp:expr, $instruction:expr, $lhs:expr, $rhs:expr, $conditio...
3
37
32
df6e1b3e8750589056f2a1ded40063308c13a4d5
Tony Arcieri
2026-01-03T20:33:26
ctutils: initial proptests (#1327) Adds initial proptests for `CtEq::ct_eq` and `CtSelect::ct_select` for all core signed and unsigned integer types
diff --git a/Cargo.lock b/Cargo.lock index 3d75b46..031abdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,6 +111,7 @@ name = "ctutils" version = "0.3.1" dependencies = [ "cmov", + "proptest", "subtle", ] diff --git a/ctutils/Cargo.toml b/ctutils/Cargo.toml index c9cb17c..fda861d 100644 --- a/ctutils/Cargo.t...
3
60
0
9fe74053cb63cce29d0cd1248a8221914f70474f
Tony Arcieri
2026-01-03T16:06:41
ctutils: add `Choice::select_u8`/`select_u16` (#1324) Rounds out support for `const fn` predication for all of the core unsigned integer types
diff --git a/ctutils/src/choice.rs b/ctutils/src/choice.rs index 494c2d4..4c6b010 100644 --- a/ctutils/src/choice.rs +++ b/ctutils/src/choice.rs @@ -275,6 +275,24 @@ impl Choice { self.select_u64(a as u64, b as u64) as i64 } + /// `const fn` helper: return `b` if `self` is [`Choice::TRUE`], otherwise...
1
34
0