-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking Issue for raw_ref_macros #73394
Comments
rustdoc displays the macro in |
Sounds like a rustdoc bug, thanks for pointing that out. Reported as #74355. |
Stabilization report(Is there a template for these? I am entirely making this up.^^) I'd like to propose stabilizing the This exposes a new primitive language ability: creating a raw pointer to something without going through an intermediate reference. This operation has been talked about in the Rust community for at least as long as I am around (I recall @arielb1 suggesting something like it). Example use cases that require such an operation are a general The aforementioned RFC proposes a new primitive syntax for these macros. However, we are not yet ready to commit to a stable syntax for these operations -- but we still would like to expose this ability to stable code. Following precedent like the Existing usersThe raw_ref operation (whether through the syntax or the macro) is already seeing some use in-tree, e.g. in #73845 and #73971. Out-of-tree, Gilnaa/memoffset#43 ports the popular An earlier crater experiment found around 50 crates that created references to unaligned fields of a packed struct. Some of those can probably be fixed by making copies instead of creating references (a common issue when using such fields in Implementation history
Potential blockers/issues
|
@RalfJung there is no template I'm aware of, I've been meaning to make one for some time |
@rfcbot fcp merge Following @RalfJung's excellent report, I propose that we stabilize the |
Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged team members:
Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
One thing to note here is that we are stabilizing things implemented with a I see they include a Lines 1477 to 1542 in 4a90e36
|
So, stabilizing this will allow
This is somewhat unfortunate, since the above-mentioned operations all have the issue that they're sometimes illegal depending on their inputs (or in the case of ptr-to- It would be nice if we figured out "unconst" soon, but I'm wondering if we should consider just stabilizing an |
In the const lang-team meeting with @rust-lang/wg-const-eval we did make some plans towards unconst operations, but nothing has happened since then I think. See the meeting notes. The first step would be an RFC specifying what "UB during CTFE" means.
That seems reasonable as well. |
@Amanieu @SimonSapin @cramertj @sfackler @withoutboats friendly reminder that there's an FCP here waiting for you. :) |
@rfcbot concern simon's concern |
@nikomatsakis: I believe this makes the macro use normal |
@SimonSapin this concern is currently preventing us from entering FCP. I think it has been conclusively answered here and here by pointing out that the concern rests on a misunderstanding of what the RFC is about. If you still have concerns left, I'd appreciate if you could let us know what they are, so that we can make progress on this. :) |
Yeah it looks like I misunderstood the RFC and my concern does not really apply. It can be considered resolved, but rfcbot seems to have ignored my command and @withoutboats formally filed a concern with the bot for me, so they need to give the resolve command. Sorry for the delay here. (I still have a feeling that the approach of this RFC is not the one I would like most. But I don’t have bandwidth at the moment to look into it more and make a better-informed opinion, and it’s already late in the process anyway to argue for a very different design.) |
@rfcbot resolve simon's concern |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Woohoo! I guess we need a stabilization PR now? |
🎉 However, if we stabilize while #74355 is unresolved, its docs will be rendered incorrectly. |
FWIW, I am still having doubt about the macro names, but no better names have been suggested yet either.
|
Another option might be |
Stabilize raw ref macros This stabilizes `raw_ref_macros` (rust-lang/rust#73394), which is possible now that rust-lang/rust#74355 is fixed. However, as I already said in rust-lang/rust#73394 (comment), I am not particularly happy with the current names of the macros. So I propose we also change them, which means I am proposing to stabilize the following in `core::ptr`: ```rust pub macro const_addr_of($e:expr) { &raw const $e } pub macro mut_addr_of($e:expr) { &raw mut $e } ``` The macro name change means we need another round of FCP. Cc `````@rust-lang/libs````` Fixes #73394
This is a tracking issue for the macro version of
raw_ref_op
(#64490).The feature gate for the issue is
#![feature(raw_ref_macros)]
.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
core::ptr::raw_const!(path)
/core::ptr::raw_mut!(path)
Potentially blocked on docs issue:[fixed in Rustdoc: Fix macros 2.0 and built-in derives being shown at the wrong path #77862]pub macro
defined in submodule is shown at the wrong path #74355Implementation history
The text was updated successfully, but these errors were encountered: