Skip to content

refactor to use &raw mut #49

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antonio-hickey
Copy link

Replacing all occurrences of addr_of_mut!(place) with &raw mut place.

This will allow us to reduce macro complexity, and improve consistency with existing reference syntax as &raw mut is similar to &mut making it fit more naturally with other existing code.

@y86-dev
Copy link
Member

y86-dev commented Apr 28, 2025

I expected the CI to fail and it didn't, turns out I had some wrong configurations there. I fixed it now, could you rebase on top of main?

Also, since I'm synchronizing the commit as-is into the linux repository, could you add a commit description similar to the one you had in the series on the rust-for-linux mailing list? Thanks!

Replacing all occurrences of `addr_of_mut!(place)`
with `&raw mut place`.

This will allow us to reduce macro complexity, and improve consistency
with existing reference syntax as `&raw mut` is similar to `&mut`
making it fit more naturally with other existing code.

Suggested-by: Benno Lossin <[email protected]>
Link: Rust-for-Linux/linux#1148
Signed-off-by: Antonio Hickey <[email protected]>
@antonio-hickey
Copy link
Author

GitHub closed the PR because I used it's native sync from upstream instead of just rebasing using git like I should've and had to do anyways haha.

@y86-dev
Copy link
Member

y86-dev commented Apr 29, 2025

The nightly-msrv check failed, we need #![feature(raw_ref_op)] in the examples and tests. This is a bit annoying, since users that rely on versions 1.81 and earlier also need to do that, so we have to document it in the README. Could you add that? Thanks!
The "proper" msrv of the crate is 1.82 (when with no default features), so it's fine for those (since raw_ref_op is stable after 1.82, right?).

@antonio-hickey
Copy link
Author

Yea I can fix the examples/tests, and update the README to account for not being stable in the nightly-msrv.

Also yea raw_ref_op went stable in 1.82, so it's fine for 1.82+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants