-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add X to crate attributes to enable message is not very clear #55941
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jonas-schievink
added
the
A-diagnostics
Area: Messages for errors, warnings, and lints
label
Jan 27, 2019
crlf0710
added
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jun 11, 2020
Triage: no change. It should be relatively straightforward to find the right span place (it's effectively |
estebank
added a commit
to estebank/rust
that referenced
this issue
Mar 7, 2024
``` error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | LL + #![feature(adt_const_params)] | ``` Fix rust-lang#55941.
estebank
added a commit
to estebank/rust
that referenced
this issue
Mar 7, 2024
``` error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | LL + #![feature(adt_const_params)] | ``` Fix rust-lang#55941.
estebank
added a commit
to estebank/rust
that referenced
this issue
Mar 14, 2024
``` error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | LL + #![feature(adt_const_params)] | ``` Fix rust-lang#55941.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 18, 2024
Provide structured suggestion for `#![feature(foo)]` ``` error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | LL + #![feature(adt_const_params)] | ``` Fix rust-lang#55941.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 18, 2024
Provide structured suggestion for `#![feature(foo)]` ``` error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | LL + #![feature(adt_const_params)] | ``` Fix rust-lang#55941.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Mar 18, 2024
Rollup merge of rust-lang#122158 - estebank:feature-sugg, r=WaffleLapkin Provide structured suggestion for `#![feature(foo)]` ``` error: `S2<'_>` is forbidden as the type of a const generic parameter --> $DIR/lifetime-in-const-param.rs:5:23 | LL | struct S<'a, const N: S2>(&'a ()); | ^^ | = note: the only supported types are integers, `bool` and `char` help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types | LL + #![feature(adt_const_params)] | ``` Fix rust-lang#55941.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The message above is what I get attempting to use try_from. The issue is that it's not clear where crate attributes are, or whey they go. The rust book makes little mention of them. Adding this to "lib.rs", causes new errors such as:
As a result, it's really not clear how to resolve this error.
The descriptive error rustc --explain E0658 also doesn't demonstrate what to do correctly.
The error message should explain which file to add the #[feature] line too. Additionally, the E0658 should explain not just what file, but what to do in a multi-file case (ie lib.rs contains mod foo, and foo.rs wants to use the feature).
This would help to make this easier to resolve and access these features.
EDIT: It would be also useful to handle the mod tests situation as well where you want to test a feature like TryFrom in mod tests, because that likely needs different/other handling?
The text was updated successfully, but these errors were encountered: