-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
unstable const fns in libcore can be ignored by const-qualification #67053
Copy link
Copy link
Closed
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
As shown in #66884 (comment) const-qualification can ignore some
const fns, in the context of libcore / rustc crates:playground
This should not compile without "miri unleashed"; const-qualification does not see this function as const since the unstable feature is not enabled, and thus does not check it.
It does not compile outside of libcore, nor if the unstable feature is enabled in libcore.
cc @ecstatic-morse @oli-obk
More discussion is also available in this zulip thread.
I have a fix and will post a PR shortly. There are a couple of existing cases in
libcorewhere this matters (forconst_ptr_offset_fromandconst_type_name), and I'll fix those at the same time.