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

Closures are recursively reachable #125996

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Jun 4, 2024

Fixes #126012.

@rustbot
Copy link
Collaborator

rustbot commented Jun 4, 2024

r? @pnkfelix

rustbot has assigned @pnkfelix.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jun 4, 2024
@tmiasko tmiasko assigned oli-obk and unassigned pnkfelix Jun 4, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Jun 4, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jun 4, 2024

📌 Commit 5d26f58 has been approved by oli-obk

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 Jun 4, 2024
@oli-obk oli-obk added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 4, 2024
fmease added a commit to fmease/rust that referenced this pull request Jun 4, 2024
…ble, r=oli-obk

Closures are recursively reachable
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#125273 (bootstrap: implement new feature `bootstrap-self-test`)
 - rust-lang#125800 (Fix `mut` static task queue in SGX target)
 - rust-lang#125903 (rustc_span: Inline some hot functions)
 - rust-lang#125920 (Allow static mut definitions with #[linkage])
 - rust-lang#125921 (coverage: Carve out hole spans in a separate early pass)
 - rust-lang#125995 (Use inline const blocks to create arrays of `MaybeUninit`.)
 - rust-lang#125996 (Closures are recursively reachable)

r? `@ghost`
`@rustbot` modify labels: rollup
@@ -157,6 +157,7 @@ impl<'tcx> ReachableContext<'tcx> {
}
hir::ImplItemKind::Type(_) => false,
},
Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => true,
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't this:

Suggested change
Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => true,
Node::Expr(&hir::Expr { kind: hir::ExprKind::Closure(hir::Closure { def_id, .. }), .. }) => recursively_reachable(def_id),

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Closures are always recursively reachable, so a call to recursively_reachable would be redundant.

@compiler-errors
Copy link
Member

Also is there a bug report or anything about this issue? Seems strange to have such little information attached to this PR 😅

@tmiasko
Copy link
Contributor Author

tmiasko commented Jun 5, 2024

The issue is from #122505 (comment). Opened a dedicated issue for tracking purposes #126012.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
…kingjubilee

Rollup of 12 pull requests

Successful merges:

 - rust-lang#123168 (Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude)
 - rust-lang#125273 (bootstrap: implement new feature `bootstrap-self-test`)
 - rust-lang#125683 (Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format)
 - rust-lang#125815 (`rustc_parse` top-level cleanups)
 - rust-lang#125903 (rustc_span: Inline some hot functions)
 - rust-lang#125906 (Remove a bunch of redundant args from `report_method_error`)
 - rust-lang#125920 (Allow static mut definitions with #[linkage])
 - rust-lang#125982 (Make deleting on LinkedList aware of the allocator)
 - rust-lang#125995 (Use inline const blocks to create arrays of `MaybeUninit`.)
 - rust-lang#125996 (Closures are recursively reachable)
 - rust-lang#126003 (Add a co-maintainer for the two ARMv4T targets)
 - rust-lang#126004 (Add another test for hidden types capturing lifetimes that outlive but arent mentioned in substs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit eb2819e into rust-lang:master Jun 5, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone Jun 5, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2024
Rollup merge of rust-lang#125996 - tmiasko:closure-recursively-reachable, r=oli-obk

Closures are recursively reachable

Fixes rust-lang#126012.
@tmiasko tmiasko deleted the closure-recursively-reachable branch June 5, 2024 14:32
@apiraino
Copy link
Contributor

Sorry this backport was accepted last week (Zulip) but I missed to mark it as such.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jun 13, 2024
@cuviper
Copy link
Member

cuviper commented Jun 14, 2024

It's too late for 1.79.0, but this could be stable-nominated if needed.

@rustbot label -beta-nominated -beta-accepted

@rustbot rustbot removed beta-nominated Nominated for backporting to the compiler in the beta channel. beta-accepted Accepted for backporting to the compiler in the beta channel. labels Jun 14, 2024
@apiraino
Copy link
Contributor

apiraino commented Jun 14, 2024

ok, then I'll stable nominate since there's another PR candidate for a stable backport (if a dot release will be considered)

@rustbot +stable-nominated

@apiraino apiraino added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Jun 14, 2024
@apiraino
Copy link
Contributor

Stable backport accpeted as per compiler team on Zulip, if a point release is planned.

A backport PR will be authored by the release team at the end of the current development cycle.

@rustbot label +stable-accepted

@rustbot rustbot added the stable-accepted Accepted for backporting to the compiler in the stable channel. label Jun 20, 2024
@cuviper
Copy link
Member

cuviper commented Aug 1, 2024

Clearing stable backport labels since we didn't ship a 1.79 point release, and this is already in current stable 1.80.0.

@rustbot label -stable-nominated -stable-accepted

@rustbot rustbot removed stable-nominated Nominated for backporting to the compiler in the stable channel. stable-accepted Accepted for backporting to the compiler in the stable channel. labels Aug 1, 2024
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.

Missing optimized MIR for an item
8 participants