Conversation
This comment has been minimized.
This comment has been minimized.
|
@rustbot blocked |
|
☔ The latest upstream changes (presumably #146052) made this pull request unmergeable. Please resolve the merge conflicts. |
c07fc68 to
c6f7eab
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready Should be good, but will fix if CI shows up with any weird issues. Now that |
c6f7eab to
003a538
Compare
003a538 to
7a17d4a
Compare
library/coretests/tests/hint.rs
Outdated
| impl const Drop for X { | ||
| fn drop(&mut self) { | ||
| self.0.set(true); | ||
| // FIXME(const-hack): Once const cells work, we could remove unsafe code here. |
There was a problem hiding this comment.
Somewhat surprised we haven't done this yet. If it doesn't require anything weird, maybe just do that first?
There was a problem hiding this comment.
I know that cells are allowed in constants now that mutable references stabilised but I had just assumed this was due to some other blocker since get is allowed but set is not.
But I guess, if that's not the case, I can go through and mark all the methods const in a separate PR.
There was a problem hiding this comment.
You can use replace already. set needs a T: [const] Destruct bound which we probably just didn't support when it was constified.
There was a problem hiding this comment.
That makes a lot of sense. I guess that also goes along with this comment I made in the const_destruct issue asking why Copy doesn't imply const Destruct, since presumably we'd be able to avoid the bounds here.
There was a problem hiding this comment.
Ha, more to add to the list of interesting things we didn't consider beforehand https://hackmd.io/ZnyR91NhQDO6aJ6EceMrQw
Makes total sense to me. Maybe leave two FIXMEs wrt cell add and removing the bound again?
r=me with that plus moving to using replace
There was a problem hiding this comment.
Oh, never mind, since Cell::set no longer requires T: Copy, it would be a true [const] Destruct bound here.
There was a problem hiding this comment.
I'm already in the middle of drafting up a PR for the cell methods, so, I'll just cc you on that one and fix this to use set here.
7a17d4a to
7a0824c
Compare
|
|
This comment has been minimized.
This comment has been minimized.
7a0824c to
6f649e4
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready Had forgotten about this, but it is no longer blocked since the Cell PR got merged. |
|
@bors r+ rollup |
Rollup of 4 pull requests Successful merges: - #145939 (const `select_unpredictable`) - #147478 (More intuitive error when using self to instantiate tuple struct with private field) - #147866 (Add built-in `const` impls for `Clone` and `Copy`) - #148153 (Fix duplicate 'the the' typos in comments) r? `@ghost` `@rustbot` modify labels: rollup
Tracking issue: #145938