Closed
Description
Code
#![allow(dead_code)]
fn foo() {}
#![feature(iter_array_chunks)]
fn bar() {}
Current output
Compiling playground v0.0.1 (/playground)
error: an inner attribute is not permitted in this context
--> src/lib.rs:3:1
|
3 | #![feature(iter_array_chunks)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | fn bar() {}
| ----------- the inner attribute doesn't annotate this function
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
help: to annotate the function, change the attribute from inner to outer style
|
3 - #![feature(iter_array_chunks)]
3 + #[feature(iter_array_chunks)]
|
Desired output
Compiling playground v0.0.1 (/playground)
error: an inner attribute is not permitted in this context
--> src/lib.rs:3:1
|
3 | #![feature(iter_array_chunks)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 | fn bar() {}
| ----------- the inner attribute doesn't annotate this function
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
Rationale and extra context
reduces distracting noise
Other cases
No response
Rust Version
rustc 1.80.0-nightly (debd22da6 2024-05-29)
binary: rustc
commit-hash: debd22da66cfa97c74040ebf68e420672ac8560e
commit-date: 2024-05-29
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6
Anything else?
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment