Add more unbounded_sh[lr] examples#150011
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
| @@ -1421,8 +1421,15 @@ macro_rules! int_impl { | |||
| /// # Examples | |||
| /// | |||
| /// ``` | |||
| #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(4), 0x10);")] | |||
| #[doc = concat!("assert_eq!(0x1", stringify!($SelfT), ".unbounded_shl(129), 0);")] | |||
| #[doc = concat!("assert_eq!(0x1_", stringify!($SelfT), ".unbounded_shl(4), 0x10);")] | |||
There was a problem hiding this comment.
annot: I use the _ in them because that pattern helps catch mistakes via https://rust-lang.github.io/rust-clippy/master/index.html#mistyped_literal_suffixes (and I think it helps readability too).
| #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shl(", stringify!($BITS), "), 0);")] | ||
| #[doc = concat!("assert_eq!(42_", stringify!($SelfT), ".unbounded_shl(1).unbounded_shl(", stringify!($BITS_MINUS_ONE), "), 0);")] |
There was a problem hiding this comment.
annot: these are here to contrast with the equivalent ones from https://github.com/rust-lang/rust/pull/149837/changes#diff-b9390ee807a1dae3c3128dce36df56748ad8d23c6e361c0ebba4d744bf6efdb9R2618-R2619
|
@bors r+ rollup |
…uwer Rollup of 8 pull requests Successful merges: - #148321 (parser/lexer: bump to Unicode 17, use faster unicode-ident) - #149540 (std: sys: fs: uefi: Implement readdir) - #149582 (Implement `Duration::div_duration_{floor,ceil}`) - #149663 (Optimized implementation for uN::{gather,scatter}_bits) - #149667 (Fix ICE by rejecting const blocks in patterns during AST lowering (closes #148138)) - #149947 (add several older crashtests) - #150011 (Add more `unbounded_sh[lr]` examples) - #150411 (refactor `destructure_const`) r? `@ghost` `@rustbot` modify labels: rollup
Inspired by #149837, which added more stuff to
wrapping_sh[lr], including a cross-reference to these methods.