-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Description
Getting the following error when attempting to use an inner attribute in a file that gets called by include!
.
error: an inner attribute is not permitted in this context
--> test.rs:1:3
|
1 | #![cfg_attr(rustfmt, rustfmt_skip)]
| ^
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
Example
test.rs
#![cfg_attr(rustfmt, rustfmt_skip)]
fn main() {
}
main.rs
include!("test.rs");
$ rustc --version --verbose
rustc 1.25.0-nightly (5965b7901 2018-01-19)
binary: rustc
commit-hash: 5965b790142eff7a8546e947914e7a8e00c61575
commit-date: 2018-01-19
host: x86_64-pc-windows-msvc
release: 1.25.0-nightly
LLVM version: 4.0
Metadata
Metadata
Assignees
Labels
No labels