Skip to content
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

Update ReadDir::next in std::sys::pal::unix::fs to use &raw const (*p).field instead of p.byte_offset().cast() #134678

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update comment on field check
  • Loading branch information
zachs18 committed Dec 23, 2024
commit f010518b331cb6207c6359ed81308a9c5d731286
3 changes: 1 addition & 2 deletions library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,7 @@ impl Iterator for ReadDir {
// being referenced.
macro_rules! entry_field_ptr {
($field:ident) => {{
// To make sure the field actually exists and is visible,
// and we aren't silently doing any Deref coercion.
// To make sure we aren't silently doing any Deref coercion.
const _: usize = mem::offset_of!(dirent64, $field);
&raw const (*entry_ptr).$field
}};
Expand Down
Loading