-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-const_generics_defaults`#![feature(const_generics_defaults)]``#![feature(const_generics_defaults)]`F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`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
Given the following code: link
#![feature(const_generics, const_generics_defaults)]
#![allow(incomplete_features)]
struct Foo<const N: usize, const M: usize = { struct Bar<const L: usize = N>; N }>;
The current output is:
error[E0401]: can't use generic parameters from outer function
--> src/lib.rs:4:75
|
4 | struct Foo<const N: usize, const M: usize = { struct Bar<const L: usize = N>; N }>;
| - const parameter from outer function ^ use of generic parameter from outer function
Ideally the output should shouldn't talk about functions but struct definitions instead
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-const_generics_defaults`#![feature(const_generics_defaults)]``#![feature(const_generics_defaults)]`F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`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.