-
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
Fix async closures in CTFE #120950
Fix async closures in CTFE #120950
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
/// These are all represented with the same `ExprKind::Closure` in the AST and HIR, | ||
/// which makes it difficult to distinguish these during def collection. Therefore, | ||
/// we treat them all the same, and code which needs to distinguish them can match | ||
/// or `hir::ClosureKind` or `type_of`. | ||
Closure, |
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.
Maybe this should also become ClosureLike
then?
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.
That's probably gonna touch a lot of code, let's do that separately
r=me on the compiler/rustc_const_eval/src/interpret/validity.rs changes. I don't understand the code in ensure_monomorphic_enough so I can't comment on that one. |
@bors r=RalfJung,oli-obk |
…, r=RalfJung,oli-obk Fix async closures in CTFE First commit renames `is_coroutine_or_closure` into `is_closure_like`, because `is_coroutine_or_closure_or_coroutine_closure` seems confusing and long. Second commit fixes some forgotten cases where we want to handle `TyKind::CoroutineClosure` the same as closures and coroutines. The test exercises the change to `ValidityVisitor::aggregate_field_path_elem` which is the source of rust-lang#120946, but not the change to `UsedParamsNeedSubstVisitor`, though I feel like it's not that big of a deal. Let me know if you'd like for me to look into constructing a test for the latter, though I have no idea what it'd look like (we can't assert against `TooGeneric` anywhere?). Fixes rust-lang#120946 r? oli-obk cc `@RalfJung`
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#118983 (Warn on references casting to bigger memory layout) - rust-lang#119451 (Gate PR CI on clippy correctness lints) - rust-lang#120273 (compiletest: few naive improvements) - rust-lang#120889 (Implement Instant for UEFI) - rust-lang#120938 (Implement sys/thread for UEFI) - rust-lang#120950 (Fix async closures in CTFE) - rust-lang#120958 (Dejargonize `subst`) - rust-lang#120965 (Add lahfsahf and prfchw target feature) - rust-lang#120970 (add another test for promoteds-in-static) - rust-lang#120979 (Update books) Failed merges: - rust-lang#120973 (allow static_mut_ref in some tests that specifically test mutable statics) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118983 (Warn on references casting to bigger memory layout) - rust-lang#119451 (Gate PR CI on clippy correctness lints) - rust-lang#120273 (compiletest: few naive improvements) - rust-lang#120950 (Fix async closures in CTFE) - rust-lang#120958 (Dejargonize `subst`) - rust-lang#120965 (Add lahfsahf and prfchw target feature) - rust-lang#120970 (add another test for promoteds-in-static) - rust-lang#120979 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#120950 - compiler-errors:miri-async-closurs, r=RalfJung,oli-obk Fix async closures in CTFE First commit renames `is_coroutine_or_closure` into `is_closure_like`, because `is_coroutine_or_closure_or_coroutine_closure` seems confusing and long. Second commit fixes some forgotten cases where we want to handle `TyKind::CoroutineClosure` the same as closures and coroutines. The test exercises the change to `ValidityVisitor::aggregate_field_path_elem` which is the source of rust-lang#120946, but not the change to `UsedParamsNeedSubstVisitor`, though I feel like it's not that big of a deal. Let me know if you'd like for me to look into constructing a test for the latter, though I have no idea what it'd look like (we can't assert against `TooGeneric` anywhere?). Fixes rust-lang#120946 r? oli-obk cc ``@RalfJung``
…, r=RalfJung,oli-obk Fix async closures in CTFE First commit renames `is_coroutine_or_closure` into `is_closure_like`, because `is_coroutine_or_closure_or_coroutine_closure` seems confusing and long. Second commit fixes some forgotten cases where we want to handle `TyKind::CoroutineClosure` the same as closures and coroutines. The test exercises the change to `ValidityVisitor::aggregate_field_path_elem` which is the source of rust-lang#120946, but not the change to `UsedParamsNeedSubstVisitor`, though I feel like it's not that big of a deal. Let me know if you'd like for me to look into constructing a test for the latter, though I have no idea what it'd look like (we can't assert against `TooGeneric` anywhere?). Fixes rust-lang#120946 r? oli-obk cc ``@RalfJung``
First commit renames
is_coroutine_or_closure
intois_closure_like
, becauseis_coroutine_or_closure_or_coroutine_closure
seems confusing and long.Second commit fixes some forgotten cases where we want to handle
TyKind::CoroutineClosure
the same as closures and coroutines.The test exercises the change to
ValidityVisitor::aggregate_field_path_elem
which is the source of #120946, but not the change toUsedParamsNeedSubstVisitor
, though I feel like it's not that big of a deal. Let me know if you'd like for me to look into constructing a test for the latter, though I have no idea what it'd look like (we can't assert againstTooGeneric
anywhere?).Fixes #120946
r? oli-obk cc @RalfJung