Closure #[target_feature] only checked during codegen #70307
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-closures
Area: Closures (`|…| { … }`)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: error because the target feature does not exist and the closure is not
unsafe
.Instead, this happened: the errors does not happen unless the closure is called in
foo
andfoo
is codegen'd. That is, I can get the expected errors by uncommenting thef();
line and running e.g.cargo build
. butcargo check
/rustc --emit metadata
doesn't give any error, nor doescargo build
give errors iffoo
is not codegen'd for other reasons (e.g., notpub
in a library, or#[inline]
).Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: