-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs #139193
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@@ -219,6 +219,8 @@ pub(crate) fn coroutine_by_move_body_def_id<'tcx>( | |||
mir::MirSource::from_instance(InstanceKind::Item(body_def.def_id().to_def_id())); | |||
dump_mir(tcx, false, "built", &"after", &by_move_body, |_, _| Ok(())); | |||
|
|||
// Feed HIR because we try to access this body's attrs in the inliner. | |||
body_def.feed_hir(); |
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.
feed_hir
both feeds the local_def_id_to_hir_id
query, and also the HIR attrs (as an empty list), which is fine here b/c you can't put attrs on the child coroutine anyways.
e69eeda
to
e2d5033
Compare
This PR changes a file inside |
@bors r=eholk |
@bors rollup |
…r=eholk Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs See the comments in the test. I'm surprised that nobody found this[^1] (edit: nvm haha), but you have to go out of your way to construct the by-move body and then inline it w/ a poll call, so I guess the inliner just never really gets into this situation before. Fixes rust-lang#134335 r? oli-obk [^1]: Well, `@eholk` found this when working on the `iter! {}` macro, since it more dramatically affects those.
…r=eholk Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs See the comments in the test. I'm surprised that nobody found this[^1] (edit: nvm haha), but you have to go out of your way to construct the by-move body and then inline it w/ a poll call, so I guess the inliner just never really gets into this situation before. Fixes rust-lang#134335 r? oli-obk [^1]: Well, ``@eholk`` found this when working on the `iter! {}` macro, since it more dramatically affects those.
Rollup of 12 pull requests Successful merges: - rust-lang#110406 (rustdoc-json: Add test for #[automatically_derived] attribute) - rust-lang#137738 (Make slice iterator constructors unstably const) - rust-lang#138492 (remove `feature(inline_const_pat)`) - rust-lang#138928 (Fix UWP reparse point check) - rust-lang#138950 (replace extra_filename with strict version hash in metrics file names) - rust-lang#139002 (Add release notes for 1.86.0) - rust-lang#139022 (increment depth of nested obligations) - rust-lang#139060 (replace commit placeholder in vendor status with actual commit) - rust-lang#139102 (coverage: Avoid splitting spans during span extraction/refinement) - rust-lang#139129 (Add tests for slice bounds check optimization) - rust-lang#139188 (PassWrapper: adapt for llvm/llvm-project@94122d58fc77079a291a3d008914…) - rust-lang#139193 (Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs) r? `@ghost` `@rustbot` modify labels: rollup
…r=eholk Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs See the comments in the test. I'm surprised that nobody found this[^1] (edit: nvm haha), but you have to go out of your way to construct the by-move body and then inline it w/ a poll call, so I guess the inliner just never really gets into this situation before. Fixes rust-lang#134335 r? oli-obk [^1]: Well, ```@eholk``` found this when working on the `iter! {}` macro, since it more dramatically affects those.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#110406 (rustdoc-json: Add test for #[automatically_derived] attribute) - rust-lang#138790 (Note potential but private items in show_candidates) - rust-lang#138950 (replace extra_filename with strict version hash in metrics file names) - rust-lang#139002 (Add release notes for 1.86.0) - rust-lang#139022 (increment depth of nested obligations) - rust-lang#139129 (Add tests for slice bounds check optimization) - rust-lang#139188 (PassWrapper: adapt for llvm/llvm-project@94122d58fc77079a291a3d008914…) - rust-lang#139193 (Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs) - rust-lang#139202 (Improve docs of ValTreeKind) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#110406 (rustdoc-json: Add test for #[automatically_derived] attribute) - rust-lang#138790 (Note potential but private items in show_candidates) - rust-lang#139002 (Add release notes for 1.86.0) - rust-lang#139022 (increment depth of nested obligations) - rust-lang#139129 (Add tests for slice bounds check optimization) - rust-lang#139188 (PassWrapper: adapt for llvm/llvm-project@94122d58fc77079a291a3d008914…) - rust-lang#139193 (Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs) - rust-lang#139202 (Improve docs of ValTreeKind) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#139193 - compiler-errors:inline-synthetic, r=eholk Feed HIR for by-move coroutine body def, since the inliner tries to read its attrs See the comments in the test. I'm surprised that nobody found this[^1] (edit: nvm haha), but you have to go out of your way to construct the by-move body and then inline it w/ a poll call, so I guess the inliner just never really gets into this situation before. Fixes rust-lang#134335 r? oli-obk [^1]: Well, ````@eholk```` found this when working on the `iter! {}` macro, since it more dramatically affects those.
See the comments in the test.
I'm surprised that nobody found this1 (edit: nvm haha), but you have to go out of your way to construct the by-move body and then inline it w/ a poll call, so I guess the inliner just never really gets into this situation before.
Fixes #134335
r? oli-obk
Footnotes
Well, @eholk found this when working on the
iter! {}
macro, since it more dramatically affects those. ↩