-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove identity_future
indirection
#104833
Conversation
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #96451) made this pull request unmergeable. Please resolve the merge conflicts. |
4194ff6
to
909a453
Compare
Fun fact, now that I changed from Though the three failing tests are still there. Though |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #105667) made this pull request unmergeable. Please resolve the merge conflicts. |
909a453
to
7075b72
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #105918) made this pull request unmergeable. Please resolve the merge conflicts. |
eccfeb3
to
5293a81
Compare
This comment has been minimized.
This comment has been minimized.
9f5db3c
to
f2360cc
Compare
The issue with HirId is an interesting one. I could just return the I believe the problem is that I have two I will have to read up on how all these things interact with each other. If someone who knows these things better than me knows a quick solution, feel free to educate me :-) |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #106399) made this pull request unmergeable. Please resolve the merge conflicts. |
In the meantime while I still struggle to properly understand HIR lowering… @nbdd0121 as you added
|
4084dcc
to
cb1c942
Compare
After a short detour messing with HIR and Ids, we are back to the known issues:
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (669e751): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
…mpiler-errors Remove `identity_future` indirection This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation. Fixes rust-lang#104826.
…errors Remove the `NodeId` of `ast::ExprKind::Async` This is a followup to rust-lang#104833 (review). In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`. It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
Remove the `NodeId` of `ast::ExprKind::Async` This is a followup to rust-lang/rust#104833 (review). In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`. It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
This function/lang_item was introduced in rust-lang#104321 as a temporary workaround of future lowering. The usage and need for it went away in rust-lang#104833. After a bootstrap update, the function itself can be removed from `std`.
…rk-Simulacrum Remove `identity_future` from stdlib This function/lang_item was introduced in rust-lang#104321 as a temporary workaround of future lowering. The usage and need for it went away in rust-lang#104833. After a bootstrap update, the function itself can be removed from `std`.
This function/lang_item was introduced in rust-lang#104321 as a temporary workaround of future lowering. The usage and need for it went away in rust-lang#104833. After a bootstrap update, the function itself can be removed from `std`.
Remove the `NodeId` of `ast::ExprKind::Async` This is a followup to rust-lang/rust#104833 (review). In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`. It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
…th-late-bound-vars-again, r=jackh726 Normalize opaques with late-bound vars again We have a hack in the compiler where if an opaque has escaping late-bound vars, we skip revealing it even though we *could* reveal it from a technical perspective. First of all, this is weird, since we really should be revealing all opaques in `Reveal::All` mode. Second of all, it causes subtle bugs (linked below). I attempted to fix this in rust-lang#100980, which was unfortunately reverted due to perf regressions on codebases that used really deeply nested futures in some interesting ways. The worst of which was rust-lang#103423, which caused the project to hang on build. Another one was rust-lang#104842, which was just a slow-down, but not a hang. I took some time afterwards to investigate how to rework `normalize_erasing_regions` to take advantage of better caching, but that effort kinda fizzled out (rust-lang#104133). However, recently, I was made aware of more bugs whose root cause is not revealing opaques during codegen. That made me want to fix this again -- in the process, interestingly, I took the the minimized example from rust-lang#103423 (comment), and it doesn't seem to hang any more... Thinking about this harder, there have been some changes to the way we lower and typecheck async futures that may have reduced the pathologically large number of outlives obligations (see description of rust-lang#103423) that we were encountering when normalizing opaques with bound vars the last time around: * rust-lang#104321 (lower `async { .. }` directly as a generator that implements `Future`, removing the `from_generator` shim) * rust-lang#104833 (removing an `identity_future` fn that was wrapping desugared future generators) ... so given that I can see: * No significant regression on rust perf bot (rust-lang#107620 (comment)) * No timeouts in crater run I did (rust-lang#107620 (comment), rechecked failing crates in rust-lang#107620 (comment)) ... and given that this PR: * Fixes rust-lang#104601 * Fixes rust-lang#107557 * Fixes rust-lang#109464 * Allows us to remove a `DefiningAnchor::Bubble` from codegen (75a8f68) I'm inclined to give this another shot at landing this. Best case, it just works -- worst case, we get more examples to study how we need to improve the compiler to make this work. r? types
This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the
min_choice
algorithm.Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the
#[track_caller]
annotation.Fixes #104826.