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

Make mem::size_of_val and mem::align_of_val unstably const #74930

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented Jul 30, 2020

Implements #46571 but does not stabilize it. I wanted this while working on something today.

The only reason not to immediately stabilize are concerns around custom DSTs. That proposal has made zero progress in the last two years and const eval is rich enough to support pretty much any user-defined len function as long as nightly features are allowed (raw_ptr_deref).

Currently, this raises a const_err lint when passed an extern type.

r? @oli-obk

cc @rust-lang/wg-const-eval

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 30, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Jul 30, 2020

@bors r+

Please also open a PR against miri, removing the intrinsics there

@bors
Copy link
Contributor

bors commented Jul 30, 2020

📌 Commit 88fd494 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 30, 2020
@bors
Copy link
Contributor

bors commented Jul 30, 2020

⌛ Testing commit 88fd494 with merge 2186722...

@bors
Copy link
Contributor

bors commented Jul 30, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: oli-obk
Pushing 2186722 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 30, 2020
@bors bors merged commit 2186722 into rust-lang:master Jul 30, 2020
@ecstatic-morse
Copy link
Contributor Author

ecstatic-morse commented Jul 30, 2020

Please also open a PR against miri, removing the intrinsics there

Resolved in rust-lang/miri#1492 (thanks Ralf!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants