-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-coroutinesArea: CoroutinesArea: CoroutinesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
Immovable generators require unsafe block, thus allowing every unsafe function inside generator to work. There is no way to say I want immovable generator, but its body should not be marked unsafe.
unsafe {
static || {
yield;
let a = Box::from_raw(0 as *mut usize);
}
};
It can probably be fixed by adding new ImmovableGenerator
trait and making creation of immovable generators safe.
cc @Zoxc
Metadata
Metadata
Assignees
Labels
A-coroutinesArea: CoroutinesArea: CoroutinesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.