Skip to content

Tracking Issue for pointer_is_aligned_for #140980

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

Open
2 of 4 tasks
mathisbot opened this issue May 13, 2025 · 0 comments
Open
2 of 4 tasks

Tracking Issue for pointer_is_aligned_for #140980

mathisbot opened this issue May 13, 2025 · 0 comments
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@mathisbot
Copy link

mathisbot commented May 13, 2025

Feature gate: #![feature(pointer_is_aligned_for)]

This is a tracking issue for adding the convenience method is_aligned_for to *const T, *mut T and NonNull<T>.

impl<T: ?Sized> *const T {
    #[must_use]
    #[inline]
    pub fn is_aligned_for<U: Sized>(self) -> bool;
}

impl<T: ?Sized> *mut T {
    #[must_use]
    #[inline]
    pub fn is_aligned_for<U: Sized>(self) -> bool;
}

impl<T: ?Sized> NonNull<T> {
    #[must_use]
    #[inline]
    pub fn is_aligned_for<U: Sized>(self) -> bool;
}

Steps / History

Unresolved Questions

None yet.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 13, 2025
@jieyouxu jieyouxu added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants