-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 the coroutine def id of an async closure the child of the closure def id #120402
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
LL | let x = async || {}; | ||
| -- the expected `async` closure body | ||
LL | let () = x(); | ||
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0} upvar_tys=?7t witness=?8t}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{closure#0}::{closure#0}
is proof of this def id relationship.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expect that proof in the test file? As a //~| NOTE main::{closure#0}::{closure#0}
for instance.
r=me either way
ee792d0
to
5d8c178
Compare
@bors r+ rollup |
…tree, r=cjgillot Make the coroutine def id of an async closure the child of the closure def id Adjust def collection to make the (inner) coroutine returned by an async closure be a def id child of the (outer) closure. This makes it easy to map from coroutine -> closure by using `tcx.parent`, since currently it's not trivial to do this.
…tree, r=cjgillot Make the coroutine def id of an async closure the child of the closure def id Adjust def collection to make the (inner) coroutine returned by an async closure be a def id child of the (outer) closure. This makes it easy to map from coroutine -> closure by using `tcx.parent`, since currently it's not trivial to do this.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#116677 (References refer to allocated objects) - rust-lang#120232 (Add support for custom JSON targets when using build-std.) - rust-lang#120266 (Improve documentation for [A]Rc::into_inner) - rust-lang#120358 (Bump Fuchsia, build tests, and use 8 core bots) - rust-lang#120373 (Adjust Behaviour of `read_dir` and `ReadDir` in Windows Implementation: Check Whether Path to Search In Exists) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120420 (Stop using derivative in rustc_pattern_analysis) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) r? `@ghost` `@rustbot` modify labels: rollup
…tree, r=cjgillot Make the coroutine def id of an async closure the child of the closure def id Adjust def collection to make the (inner) coroutine returned by an async closure be a def id child of the (outer) closure. This makes it easy to map from coroutine -> closure by using `tcx.parent`, since currently it's not trivial to do this.
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#120358 (Bump Fuchsia, build tests, and use 8 core bots) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120420 (Stop using derivative in rustc_pattern_analysis) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) - rust-lang#120428 (hir: Two preparatory changes for rust-lang#120206) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#120358 (Bump Fuchsia, build tests, and use 8 core bots) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120420 (Stop using derivative in rustc_pattern_analysis) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) - rust-lang#120428 (hir: Two preparatory changes for rust-lang#120206) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#120358 (Bump Fuchsia, build tests, and use 8 core bots) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120420 (Stop using derivative in rustc_pattern_analysis) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) - rust-lang#120428 (hir: Two preparatory changes for rust-lang#120206) r? `@ghost` `@rustbot` modify labels: rollup
…tree, r=cjgillot Make the coroutine def id of an async closure the child of the closure def id Adjust def collection to make the (inner) coroutine returned by an async closure be a def id child of the (outer) closure. This makes it easy to map from coroutine -> closure by using `tcx.parent`, since currently it's not trivial to do this.
Rollup of 10 pull requests Successful merges: - rust-lang#116677 (References refer to allocated objects) - rust-lang#119991 (Reject infinitely-sized reads from io::Repeat) - rust-lang#120266 (Improve documentation for [A]Rc::into_inner) - rust-lang#120376 (Update codegen test for LLVM 18) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120424 (raw pointer metadata API: data address -> data pointer) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) - rust-lang#120428 (hir: Two preparatory changes for rust-lang#120206) - rust-lang#120434 (Revert outdated version of "Add the wasm32-wasi-preview2 target") - rust-lang#120443 (Fixes footnote handling in rustdoc) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#120358 (Bump Fuchsia, build tests, and use 8 core bots) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120420 (Stop using derivative in rustc_pattern_analysis) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) - rust-lang#120428 (hir: Two preparatory changes for rust-lang#120206) r? `@ghost` `@rustbot` modify labels: rollup
…llaumeGomez Rollup of 18 pull requests Successful merges: - rust-lang#119123 (Add triagebot mentions entry for simd intrinsics) - rust-lang#119991 (Reject infinitely-sized reads from io::Repeat) - rust-lang#120172 (bootstrap: add more unit tests) - rust-lang#120250 (rustdoc: Prevent JS injection from localStorage) - rust-lang#120376 (Update codegen test for LLVM 18) - rust-lang#120387 (interpret/memory: fix safety comment for large array memset optimization) - rust-lang#120400 (Bound errors span label cleanup) - rust-lang#120402 (Make the coroutine def id of an async closure the child of the closure def id) - rust-lang#120403 (Add instructions of how to use pre-vendored 'rustc-src') - rust-lang#120424 (raw pointer metadata API: data address -> data pointer) - rust-lang#120425 (Remove unnecessary unit returns in query declarations) - rust-lang#120439 (Move UI issue tests to subdirectories) - rust-lang#120443 (Fixes footnote handling in rustdoc) - rust-lang#120452 (std: Update documentation of seek_write on Windows) - rust-lang#120460 (Be more careful about interpreting a label/lifetime as a mistyped char literal.) - rust-lang#120464 (Add matthewjasper to some review groups) - rust-lang#120467 (Update books) - rust-lang#120488 (Diagnostic lifetimes cleanups) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120402 - compiler-errors:async-closure-def-tree, r=cjgillot Make the coroutine def id of an async closure the child of the closure def id Adjust def collection to make the (inner) coroutine returned by an async closure be a def id child of the (outer) closure. This makes it easy to map from coroutine -> closure by using `tcx.parent`, since currently it's not trivial to do this.
Adjust def collection to make the (inner) coroutine returned by an async closure be a def id child of the (outer) closure. This makes it easy to map from coroutine -> closure by using
tcx.parent
, since currently it's not trivial to do this.