Skip to content

Commit 41227f9

Browse files
authored
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``
2 parents dbccecf + 4fbd5cc commit 41227f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/redundant_locals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantLocals {
101101
fn is_by_value_closure_capture(cx: &LateContext<'_>, redefinition: HirId, root_variable: HirId) -> bool {
102102
let closure_def_id = cx.tcx.hir().enclosing_body_owner(redefinition);
103103

104-
cx.tcx.is_closure_or_coroutine(closure_def_id.to_def_id())
104+
cx.tcx.is_closure_like(closure_def_id.to_def_id())
105105
&& cx.tcx.closure_captures(closure_def_id).iter().any(|c| {
106106
matches!(c.info.capture_kind, UpvarCapture::ByValue)
107107
&& matches!(c.place.base, PlaceBase::Upvar(upvar) if upvar.var_path.hir_id == root_variable)

0 commit comments

Comments
 (0)