-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Add more unbounded_sh[lr] examples
#150011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annot: these are here to contrast with the equivalent ones from https://github.com/rust-lang/rust/pull/149837/changes#diff-b9390ee807a1dae3c3128dce36df56748ad8d23c6e361c0ebba4d744bf6efdb9R2618-R2619
Inspired by #149837, which added more stuff to
wrapping_sh[lr], including a cross-reference to these methods.