Skip to content

rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts. - #62275

Merged
bors merged 1 commit into
rust-lang:masterfrom
eddyb:const-drop-replace
Jul 11, 2019
Merged

rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.#62275
bors merged 1 commit into
rust-lang:masterfrom
eddyb:const-drop-replace

Conversation

@eddyb

@eddybeddyb commented Jul 1, 2019

Copy link
Copy Markdown
Contributor

This slipped through the cracks and never got implemented (thankfully that just meant it was overly conservative and didn't allow assignments that don't actually drop the previous value).
Fixes#62273.

r? @oli-obk

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 1, 2019
Comment threadsrc/test/ui/consts/const-eval/const_let.rs Outdated
@eddyb
eddybforce-pushed the const-drop-replace branch from 434d187 to f6e5ac6CompareJuly 2, 2019 06:34
@eddyb

eddyb commented Jul 5, 2019

Copy link
Copy Markdown
ContributorAuthor

r? @pnkfelix

Oh, also, cc @oli-obk this might need qualify_min_consts support as well.

@rust-highfiverust-highfive assigned pnkfelix and unassigned oli-obkJul 5, 2019
@pnkfelix

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Jul 10, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit f6e5ac6 has been approved by pnkfelix

@borsbors 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 10, 2019
Centril added a commit to Centril/rust that referenced this pull request Jul 10, 2019
rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.
This slipped through the cracks and never got implemented (thankfully that just meant it was overly conservative and didn't allow assignments that don't *actually* drop the previous value).
Fixesrust-lang#62273.
r? @oli-obk
@CentrilCentril mentioned this pull request Jul 10, 2019
bors added a commit that referenced this pull request Jul 10, 2019
Rollup of 5 pull requests
Successful merges:
- #62275 (rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.)
- #62465 (Sometimes generate storage statements for temporaries with type `!`)
- #62481 (Use `fold` in `Iterator::last` default implementation)
- #62493 (#62357: doc(ptr): add example for {read,write}_unaligned)
- #62532 (Some more cleanups to syntax::print)
Failed merges:
r? @ghost
bors added a commit that referenced this pull request Jul 10, 2019
Rollup of 5 pull requests
Successful merges:
- #62275 (rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.)
- #62465 (Sometimes generate storage statements for temporaries with type `!`)
- #62481 (Use `fold` in `Iterator::last` default implementation)
- #62493 (#62357: doc(ptr): add example for {read,write}_unaligned)
- #62532 (Some more cleanups to syntax::print)
Failed merges:
r? @ghost
@bors
bors merged commit f6e5ac6 into rust-lang:masterJul 11, 2019
@bors

bors commented Jul 11, 2019

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #62561) made this pull request unmergeable. Please resolve the merge conflicts.

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 11, 2019
@eddyb
eddyb deleted the const-drop-replace branch July 11, 2019 05:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initialization by assignment not allowed for "drop-ful" types in constants.

6 participants

@eddyb@pnkfelix@bors@oli-obk@Centril@rust-highfive