Closed
Description
Calling an unsafe function inside a generator doesn't require unsafe
block.
#![feature(generators)]
fn main() {
let _ = || loop {
::std::ptr::read_volatile(0 as *const u32);
// Try to uncomment and the error will disappear:
// yield;
};
}
I expected to see an error in both cases: commented and uncommented yield
. Instead the error disappear when using a generator.
Meta
rustc --version --verbose
:
rustc 1.23.0-nightly (90ef3372e 2017-10-29)
binary: rustc
commit-hash: 90ef3372e8ad74517eafa61e9494688c258b15ce
commit-date: 2017-10-29
host: x86_64-unknown-linux-gnu
release: 1.23.0-nightly
LLVM version: 4.0