-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-destructorsArea: Destructors (`Drop`, …)Area: Destructors (`Drop`, …)C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Code
I tried this code:
pub const fn f<T, const N: usize>(_: [std::mem::MaybeUninit<T>; N]) {}
I expected it to compile successfully. Instead, this happened:
error[E0493]: destructor of `[MaybeUninit<T>; N]` cannot be evaluated at compile-time
--> x.rs:1:35
|
1 | pub const fn f<T, const N: usize>(_: [std::mem::MaybeUninit<T>; N]) {}
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions
Version it worked on
It most recently worked on 1.72
Version with regression
Regressed in aafd75a cc @fee1-dead @oli-obk
Originally reported in #115403 (comment) cc @itsxaos
@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged
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-destructorsArea: Destructors (`Drop`, …)Area: Destructors (`Drop`, …)C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.