Closed
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.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint; hard to understand for new users.Relevant to the compiler team, which will review and decide on the PR/issue.