Closed
Description
When writing a const generic that uses a type other than bool
, char
or integer
, the compiler generates the following error message:
error: `std::sync::atomic::Ordering` is forbidden as the type of a const generic parameter
--> src/lib.rs:5:21
|
5 | struct Bug<const O: atomic::Ordering>;
| ^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
= help: more complex types are supported with `#[feature(const_generics)]`
However, this error message is wrong, as its missing a !
in the feature suggestion.
It should be #![feature(const_generics)]
rather than #[feature(const_generics)]
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Area: Messages for errors, warnings, and lintsBlocker: Implemented in the nightly compiler and unstable.Category: This is a bug.Diagnostics: An error or lint that needs small tweaks.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.