Skip to content

Commit

Permalink
add effects feature
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacholt100 committed Jul 3, 2024
1 parent b1116da commit 8c06221
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The `valuable` feature enables the [`Valuable`](https://docs.rs/valuable/latest/

### Nightly features

Activating the `nightly` feature will enable the `from_be_bytes`, `from_le_bytes`, `from_ne_bytes`, `to_be_bytes`, `to_le_bytes` and `to_ne_bytes` methods on `bnum`'s unsigned and signed integers and will make the `unchecked_...` methods `const`. This comes at the cost of only being able to compile on nightly. The nightly features that this uses are [`generic_const_exprs`](https://github.com/rust-lang/rust/issues/76560), [`const_trait_impl`](https://github.com/rust-lang/rust/issues/67792) and [`const_option_ext`](https://github.com/rust-lang/rust/issues/91930).
Activating the `nightly` feature will enable the `from_be_bytes`, `from_le_bytes`, `from_ne_bytes`, `to_be_bytes`, `to_le_bytes` and `to_ne_bytes` methods on `bnum`'s unsigned and signed integers and will make the `unchecked_...` methods `const`. This comes at the cost of only being able to compile on nightly. The nightly features that this uses are [`generic_const_exprs`](https://github.com/rust-lang/rust/issues/76560), [`const_trait_impl`](https://github.com/rust-lang/rust/issues/67792), [`effects`](https://github.com/rust-lang/rust/issues/102090) and [`const_option_ext`](https://github.com/rust-lang/rust/issues/91930).

## Testing

Expand Down
28 changes: 0 additions & 28 deletions src/int/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,37 +200,10 @@ macro_rules! all_shift_impls {
i128
);

#[cfg(feature = "usize_exptype")]
crate::int::ops::try_shift_impl!(
$Struct, $BUint, $BInt;
Shl,
shl,
ShlAssign,
shl_assign,
"attempt to shift left with overflow",
u32,
u64,
u128
);

#[cfg(feature = "usize_exptype")]
crate::int::ops::try_shift_impl!(
$Struct, $BUint, $BInt;
Shr,
shr,
ShrAssign,
shr_assign,
"attempt to shift right with overflow",
u32,
u64,
u128
);

crate::int::ops::shift_impl!($Struct, Shl, shl, ShlAssign, shl_assign, u8, u16);

crate::int::ops::shift_impl!($Struct, Shr, shr, ShrAssign, shr_assign, u8, u16);

#[cfg(not(feature = "usize_exptype"))]
crate::int::ops::try_shift_impl!(
$Struct, $BUint, $BInt;
Shl,
Expand All @@ -243,7 +216,6 @@ macro_rules! all_shift_impls {
u128
);

#[cfg(not(feature = "usize_exptype"))]
crate::int::ops::try_shift_impl!(
$Struct, $BUint, $BInt;
Shr,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
feature(
generic_const_exprs,
const_trait_impl,
const_option_ext
const_option_ext,
effects,
)
)]
#![cfg_attr(
Expand All @@ -15,7 +16,6 @@
float_minimum_maximum,
wrapping_next_power_of_two,
float_next_up_down,
unchecked_math,
unchecked_shifts,
)
)]
Expand Down

0 comments on commit 8c06221

Please sign in to comment.