Skip to content

Coroutine state transform check_must_not_suspend_ty ignores allocator field of Box #122643

Closed
@RalfJung

Description

@RalfJung

This code here has a potential issue:

ty::Adt(..) if ty.is_box() => {
let boxed_ty = ty.boxed_ty();
let descr_pre = &format!("{}boxed ", data.descr_pre);
check_must_not_suspend_ty(
tcx,
boxed_ty,
hir_id,
param_env,
SuspendCheckData { descr_pre, ..data },
)
}

If the Box has a custom allocator, then that will not be checked at all. So whatever check_must_not_suspend_ty is used for, it ignores anything stored in custom allocators.

It seems like this is just for a lint, so this is probably not critical, but I guess should still be fixed.

Cc @cjgillot -- not sure whom else to ping for coroutine state machine transform things?

Metadata

Metadata

Labels

A-coroutinesArea: CoroutinesT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions