-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.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
I spent a while wondering why I was getting this error
error[E0658]: use of unstable library feature 'array_map'
--> src/board.rs:67:17
|
67 | offsets.map(|(dx, dy)| {
| ^^^
|
= note: see issue #75243 <https://github.com/rust-lang/rust/issues/75243> for more information
= help: add `#![feature(array_map)]` to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
even when I added !#[feature(array_map)]
to the top of my file, and even when the same thing was working fine in main.rs
. I finally found this stackoverflow post and this reddit thread that said if I were using cargo build
I had to add the directive to lib.rs
instead, after which everything worked.
I'm not sure where in the docs the best place for that would be (I had already read the section on attributes and crates in "rust by example" and not found the relevant hint), but it would be nice if it could be surfaced in the error message too.
a123wt
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.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.