-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.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.WG-const-evalWorking group: Const evaluationWorking group: Const evaluation
Description
All stable const fn
in core/alloc/std are checked to ensure that they, transitively, do not use any unstable const features.
However, the same is not the case for const items. A stable fn
can use array lengths, and a stable trait can have associated const, that use arbitrary unstable const features. That seems bad? I'm not entirely sure how to fix that though -- these items don't themselves have any stability, after all. They are just use in a large function (that may not even be a const fn
).
One example where we are actually doing this is here:
buf: [u8; unsafe { CMSG_SPACE(SCM_MSG_LEN as u32) as usize }], |
CMSG_SPACE
is a const fn
defined in libc. It is not subject to any recursive const stability checks.
Cc @rust-lang/wg-const-eval @compiler-errors
compiler-errors
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.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.WG-const-evalWorking group: Const evaluationWorking group: Const evaluation