-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.
Description
The following produces no warnings:
pub const A: [i32;3] = [1,2,3];
pub const FOO: i32 = A[100000];
fn main() { println!("Verified"); }
But any attempt to use the FOO const will give error[E0080]: constant evaluation error
.
It would be nice for it to at least warn. and perhaps start erring once the "error on use" case can be handled with a stable const fn
.
Ralith, Havvy, retep998, CAD97, Seadragon91 and 5 more
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, ...)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.