-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Closure #[target_feature] only checked during codegen #70307
Copy link
Copy link
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
fooandfoois codegen'd. That is, I can get the expected errors by uncommenting thef();line and running e.g.cargo build. butcargo check/rustc --emit metadatadoesn't give any error, nor doescargo buildgive errors iffoois not codegen'd for other reasons (e.g., notpubin a library, or#[inline]).Meta
rustc --version --verbose: