Uh oh!
There was an error while loading. Please reload this page.
Reject static async closures in AST lowering - #145605
Conversation
This comment has been minimized.
This comment has been minimized.
compiler-errors
commented
Aug 19, 2025
Rejecting this pre-expansion should be covered by #145604, but I guess we don't necessarily need to parse the combination at all. |
compiler-errors
commented
Aug 19, 2025
Let's see what the fallout is tho. @bors2 try |
This comment has been minimized.
This comment has been minimized.
Reject async closures in AST lowering
compiler-errors
commented
Aug 19, 2025
TODO: add a test for |
This comment has been minimized.
This comment has been minimized.
I'll bless the spans when bors is back |
I think there is one test in rust-analyzer that this will break too |
fmease
commented
Aug 19, 2025
rust-analyzer doesn't depend on rustc like that, so no, that shouldn't happen. |
compiler-errors
commented
Aug 19, 2025
@craterbot check |
craterbot
commented
Aug 19, 2025
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
craterbot
commented
Aug 19, 2025
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
72990c5 to
f999a90Comparerustbot
commented
Aug 19, 2025
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
craterbot
commented
Aug 20, 2025
🎉 Experiment
|
fmease
commented
Aug 20, 2025
All spurious as far as I can tell. |
There was a problem hiding this comment.
TODO: add a test for
static gen || {}too.
.
but I guess we don't necessarily need to parse the combination at all.
Do you mean rejecting static || {} (and async, gen) in the parser unless it's #[coroutine] static || {}? That'd be quite surprising and also unprecedented if I'm not mistaken (namely, looking through the attributes at parse time), tho I guess it's technically possible since built-in attributes can never be shadowed by user-defined attributes (we reject such cases with ambiguity).
Regarding the 'gen || {} doesn't parse <-> static gen || {} parses and "works"' situation, I guess we want to do that in a separate PR? Esp. if it needs further discussions with oli. E.g, we also parse async gen || {} but bug! during AST lowering. I don't know what the untold plans are for all of these features.
r=me with static gen closure test added unless you also want to address some of the other things I mentioned above in this PR.
compiler-errors
commented
Aug 20, 2025
No, i mean making |
Ah, sounds good! Let's do that once the results for #145604 are back! Edit: Results are back and they're clean! Feel free to proceed :) |
Anyone is welcome to pick this back up. |
Bug reported in https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/static.20async.20closures/with/535095775.
r? fmease