-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Add primitive numeric traits #124243
Add primitive numeric traits #124243
Conversation
CAD97
commented
Apr 21, 2024
- Draft implementation accompanying ACP: primitive numeric traits libs-team#371
rustbot has assigned @workingjubilee. Use |
This comment has been minimized.
This comment has been minimized.
If this is to actually land, I'll probably want to take a stab at refactoring the primitive impl macros to reduce duplication of the docs, e.g. something like macro_rules! int_methods {
(
type Self = $SelfT:ty;
// …
$callback:path!($);
) => {
$callback!(
#[doc(concat!(…))]
fn count_ones;
);
// …
};
}
trait Integer {
int_methods!(
type Self = Self;
int_decl!($);
);
}
impl i32 {
int_methods!(
type Self = i32;
int_impl!($);
);
} I'm not 100% confident this'd be an overall improvement, but centralizing the docs so they can't diverge at least sounds good on paper. (Such could land separately.) |
d06246a
to
2cd0a21
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot)
|
Closing this as the ACP seems unlikely to be accepted. |