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

Encode const mir for closures if they're const #106917

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

compiler-errors
Copy link
Member

Fixes #106913

@rustbot
Copy link
Collaborator

rustbot commented Jan 15, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 15, 2023
@@ -900,14 +900,13 @@ fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
let always_encode_mir = tcx.sess.opts.unstable_opts.always_encode_mir;
(is_const_fn, needs_inline || always_encode_mir)
}
// Closures can't be const fn.
DefKind::Closure => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we simply merge this arm with the previous one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I guess the only diff is that call to is_const_default_method

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after merging with previous arm

@tmiasko
Copy link
Contributor

tmiasko commented Jan 18, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jan 18, 2023

📌 Commit 3a4fdcf has been approved by tmiasko

It is now in the queue for this repository.

@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 Jan 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 19, 2023
…mpiler-errors

Rollup of 8 pull requests

Successful merges:

 - rust-lang#105796 (rustdoc: simplify JS search routine by not messing with lev distance)
 - rust-lang#106753 (Make sure that RPITITs are not considered suggestable)
 - rust-lang#106917 (Encode const mir for closures if they're const)
 - rust-lang#107004 (Implement some candidates for the new solver (redux))
 - rust-lang#107023 (Stop using `BREAK` & `CONTINUE` in compiler)
 - rust-lang#107030 (Correct typo)
 - rust-lang#107042 (rustdoc: fix corner cases with "?" JS keyboard command)
 - rust-lang#107045 (rustdoc: remove redundant CSS rule `#settings .setting-line`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a637e2a into rust-lang:master Jan 19, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 19, 2023
@compiler-errors compiler-errors deleted the const-closure-foreign branch August 11, 2023 19:57
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ICE]: #![feature(const_closures)] inter crate ICE
6 participants