rust/src/libcore/num
Dylan DPC b6e03c464a
Rollup merge of #69813 - thomcc:nonzero-bitor, r=Amanieu
Implement BitOr and BitOrAssign for the NonZero integer types

This provides overloaded operators for `NonZero$Int | NonZero$Int`, `NonZero$Int | $Int`, and `$Int | NonZero$Int`. It also provides `BitOrAssign` where `self` is `NonZero$Int`, for symmetry.

It's a pretty small conceptual addition, but is good becasue but avoids a case where the operation is obviously sound, but you'd otherwise need unsafe to do it.

In crates trying to minimize `unsafe` usage, this is unfortunate and makes working with `NonZero` types often not worth it, even if the operations you're doing are clearly sound.

I've marked these as stable as I've been told in the past that trait impls are automatically stable. I'm happy to change it to unstable if this wasn't correct information.

I'm not entirely confident what version I should have put down, so I followed https://www.whatrustisit.com. Hopefully it's correct for this.

Apologies in advance if this has come up before, but I couldn't find it.
2020-04-25 18:30:24 +02:00
..
dec2flt Dogfood or_patterns in the standard library 2020-04-16 12:44:57 -07:00
flt2dec Use assoc float consts instead of module level 2020-04-20 23:38:06 +02:00
bignum.rs Use Self instead of $type 2020-01-06 04:33:31 +00:00
diy_float.rs Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
f32.rs Use assoc float consts instead of module level 2020-04-20 23:38:06 +02:00
f64.rs Use assoc float consts instead of module level 2020-04-20 23:38:06 +02:00
i8.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
i16.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
i32.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
i64.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
i128.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
int_macros.rs Define module level int consts from assoc consts 2020-04-20 23:38:06 +02:00
isize.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
mod.rs Rollup merge of #69813 - thomcc:nonzero-bitor, r=Amanieu 2020-04-25 18:30:24 +02:00
u8.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
u16.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
u32.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
u64.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
u128.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
usize.rs Add notice about using new consts in new code on int modules 2020-02-12 20:20:56 +01:00
wrapping.rs Propagate cfg bootstrap 2019-12-18 12:16:19 -05:00