Improve error reporting for #![feature(...)] in the wrong place #81370
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I spent a while wondering why I was getting this error
even when I added
!#[feature(array_map)]
to the top of my file, and even when the same thing was working fine inmain.rs
. I finally found this stackoverflow post and this reddit thread that said if I were usingcargo build
I had to add the directive tolib.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.
The text was updated successfully, but these errors were encountered: