docs.rs failed to build wrapping_macros-0.4.4
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
wrapping_macros-0.4.13
wrapping_macros
A macro for wrapping arithmetic.
Any code within a wrapping! { .. }
block will be transformed as follows:
a + b
becomesa.wrapping_add(b)
. Similarly for-
,*
,/
,%
,<<
,>>
.a += b
becomesa = a.wrapping_add(b)
. Similarly for-=
,*=
,/=
,%=
,<<=
,>>=
.-a
becomesa.wrapping_neg()
.
See this Internals thread for the motivation behind this crate.
Note: This crate uses internal compiler APIs, and so requires the Nightly version of Rust.
Cargo
Add this to your Cargo.toml
:
= "*"
Example
Caveats
-
This crate uses unstable APIs, and will only work on Rust Nightly.
-
You cannot nest another macro invocation within a
wrapping!
block. For example, this will not work:let x = 41i32; wrapping!
Instead, move the macro call out of the block:
let x = 41i32; println!;