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 ptr::write const #81167

Merged
merged 1 commit into from
Feb 25, 2021
Merged

Make ptr::write const #81167

merged 1 commit into from
Feb 25, 2021

Conversation

usbalbin
Copy link
Contributor

@usbalbin usbalbin commented Jan 18, 2021

The code in this PR as of right now is not much more than an experiment.

This should, if I am not mistaken, in theory compile and pass the tests once the bootstraping compiler is updated. Thus the PR is blocked on that which should happen some time after the February the 9th. Also we might want to wait for #79989 to avoid regressing performance due to using mem::forget over intrinsics::forget.

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 18, 2021
@rust-log-analyzer

This comment has been minimized.

library/core/src/ptr/mod.rs Outdated Show resolved Hide resolved
library/core/src/ptr/mod.rs Outdated Show resolved Hide resolved
@usbalbin usbalbin force-pushed the const_write branch 3 times, most recently from 5b9824c to b88cb40 Compare January 18, 2021 22:00
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 19, 2021

cc @rust-lang/wg-const-eval

@bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@usbalbin usbalbin changed the title Experiment - Make ptr::write const Make ptr::write const Feb 5, 2021
@usbalbin
Copy link
Contributor Author

usbalbin commented Feb 5, 2021

I have reverted the &mut hack that made this compile without the new bootstrapping compiler. The tests will fail until the bootstrapping compiler is updated(which is expected to happen some time after the 9th).

@bors

This comment has been minimized.

@usbalbin
Copy link
Contributor Author

Should this work now that #82076 is merged?

@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member

RalfJung commented Feb 23, 2021

Looks like it still requires const_refs_to_cell?

EDIT: And that makes sense, the check is still unstable of course.

@oli-obk oli-obk marked this pull request as ready for review February 23, 2021 16:27
@oli-obk
Copy link
Contributor

oli-obk commented Feb 23, 2021

One more thing, can you either remove the back and forth in the commits or just squash them down to one?

@oli-obk
Copy link
Contributor

oli-obk commented Feb 24, 2021

@bors r+

Thanks for bearing with us through this back and forth!

@bors
Copy link
Contributor

bors commented Feb 24, 2021

📌 Commit 89c7610 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 Feb 24, 2021
@usbalbin
Copy link
Contributor Author

Thank you both for helping me :)

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 24, 2021
Make ptr::write const

~~The code in this PR as of right now is not much more than an experiment.~~

~~This should, if I am not mistaken, in theory compile and pass the tests once the bootstraping compiler is updated. Thus the PR is blocked on that which should happen some time after the February the 9th. Also we might want to wait for rust-lang#79989 to avoid regressing performance due to using `mem::forget` over `intrinsics::forget`~~.
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 25, 2021
Rollup of 16 pull requests

Successful merges:

 - rust-lang#75807 (Convert core/num/mod.rs to intra-doc links)
 - rust-lang#80534 (Use #[doc = include_str!()] in std)
 - rust-lang#80553 (Add an impl of Error on `Arc<impl Error>`.)
 - rust-lang#81167 (Make ptr::write const)
 - rust-lang#81575 (rustdoc: Name fields of `ResolutionFailure::WrongNamespace`)
 - rust-lang#81713 (Account for associated consts in the "unstable assoc item name colission" lint)
 - rust-lang#82078 (Make char and u8 methods const)
 - rust-lang#82087 (Fix ICE caused by suggestion with no code substitutions)
 - rust-lang#82090 (Do not consider using a semicolon inside of a different-crate macro)
 - rust-lang#82213 (Slices for vecs)
 - rust-lang#82214 (Remove redundant to_string calls)
 - rust-lang#82220 (fix the false 'defined here' messages)
 - rust-lang#82313 (Update normalize.css to 8.0.1)
 - rust-lang#82321 (AST: Remove some unnecessary boxes)
 - rust-lang#82364 (Improve error msgs when found type is deref of expected)
 - rust-lang#82514 (Update Clippy)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4b9c213 into rust-lang:master Feb 25, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 25, 2021
@jplatte jplatte mentioned this pull request Mar 4, 2021
65 tasks
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 9, 2021
…Mark-Simulacrum

Make copy/copy_nonoverlapping fn's again

Make copy/copy_nonoverlapping fn's again, rather than intrinsics.

This a short-term change to address issue rust-lang#84297.

It effectively reverts PRs rust-lang#81167 rust-lang#81238 (and part of rust-lang#82967), rust-lang#83091, and parts of rust-lang#79684.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 17, 2021
…Mark-Simulacrum

Make copy/copy_nonoverlapping fn's again

Make copy/copy_nonoverlapping fn's again, rather than intrinsics.

This a short-term change to address issue rust-lang#84297.

It effectively reverts PRs rust-lang#81167 rust-lang#81238 (and part of rust-lang#82967), rust-lang#83091, and parts of rust-lang#79684.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

8 participants