-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
In const fn
in a macro call, raw ptr deref does not work even inside unsafe
#75340
Comments
const fn
with macro
, raw ptr deref does not work even inside unsafe
const fn
in a macro call, raw ptr deref does not work even inside unsafe
Ah, adding the |
Yes and no. The MIR is
So... I guess we need to change
GeneralAndConstFn
|
Has this ticket been picked up by anyone? If not, I'd be happy to hop in (especially if it's as easy as changing that one argument!) |
@mlodato517 Hello, can I take this issue? This is my first time trying to make a PR. Thank you. |
That's okay with me (unless someone got here before both of us and took it 😉) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@5M1Sec please post PR-specific questions in the PR, not the issue. That just mixes up the discussion about a particular fix and the discussion about the problem in general -- very confusing. Instead, leave a message here to point out that a PR exists, or ping people on the PR. I hid your comment here to avoid that confusion. |
Allowing raw ptr dereference in const fn Reflect on issue rust-lang#75340 Discussion in previous PR rust-lang#75425 ## Updates Change `UnsafetyViolationKind::General` to `UnsafetyViolationKind::GeneralAndConstFn` in check_unsafety.rs Remove `unsafe` in min_const_fn_unsafe_bad.rs Bless min_const_fn Add the test case from issue 75340 *** Sorry for the chaos. I messed up and ended up deleting the repo in the last PR. I have to create a new PR for the new repo. I will make a feature branch next time. I will edit the old PR once I receive the commends. @RalfJung Thank you all for your replies. They are helpful! r? @oli-obk
With #75578 having landed, is there anything left to do here? |
depends on whether we want this to work without the |
For me, "deref" is the unary Closing then. |
The following code should build, but for some reason it does not:
Removing the
const
or adding aconst_fn
feature gate makes it build.Cc @oli-obk @petrochenkov
The text was updated successfully, but these errors were encountered: