-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-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.
Description
#![feature(const_generics, use std::mem)]
pub struct Bar<const N: usize>;
and
#![feature(const_generics, 'other_feature)]
pub struct Bar<const N: usize>;
Both emit both a parse error and
error[E0658]: const generics are unstable
--> src/lib.rs:3:22
|
3 | pub struct Bar<const N: usize>;
| ^
|
= note: see issue #74878 <https://github.com/rust-lang/rust/issues/74878> for more information
= help: add `#![feature(min_const_generics)]` to the crate attributes to enable
Ideally we should still accept the features parsed before that error, so it would be nice to only emit the parse error here.
Split out from #80077, thanks @leonardo-m for opening that issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-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.