-
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
remove const_raw_ptr_to_usize_cast feature #87020
Conversation
@@ -397,9 +397,13 @@ impl NonConstOp for PanicNonStr { | |||
} | |||
} | |||
|
|||
/// Comparing raw pointers for equality. | |||
/// Not currently intended to ever be allowed, even behind a feature gate: operation depends on | |||
/// allocation base addresses that are not known at compile-time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any other "ops" that should get a comment like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well... there are similarly unallowable things. thread local statics, static mut, inline asm, ... they aren't really different, just more obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yeah those are less subtle.
//~| ERROR: type annotations needed | ||
[(); &(static || {}) as *const _ as usize]; | ||
//~^ ERROR: closures cannot be static | ||
//~| ERROR evaluation of constant value failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has long stopped testing the right thing... looks like someone adjusted the expected errors without realizing that this makes the test pointless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, looks like this was actually about testing an ICE: #66331.
But with the feature gate gone I don't think keeping the test makes a lot of sense.
368cf15
to
1a40c3d
Compare
This comment has been minimized.
This comment has been minimized.
1a40c3d
to
5f0dd6d
Compare
This comment has been minimized.
This comment has been minimized.
8c70d09
to
f5094aa
Compare
@bors r+ |
📌 Commit f5094aa has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#87006 (Revert the revert of renaming traits::VTable to ImplSource) - rust-lang#87011 (avoid reentrant lock acquire when ThreadIds run out) - rust-lang#87013 (Fix several ICEs related to malformed `#[repr(...)]` attributes) - rust-lang#87020 (remove const_raw_ptr_to_usize_cast feature) - rust-lang#87028 (Fix type: `'satic` -> `'static`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This feature currently has the strange status of "const-only
unsafe
", which was an experiment that we no longer think is a good idea. We need to find better ways to enable things like "messing with the low bits of a pointer" during CTFE.r? @oli-obk