Crate level attribute does not work in file included by include
macro
#99804
Labels
C-bug
Category: This is a bug.
include
macro
#99804
I want to share deny warnings settings among multiple crates,
so I want to use the include! macro to include files
I tried this code:
I expected to see this happen: Compilation success
Instead, this happened:
error: an inner attribute is not permitted in this context
--> deny_warnings.rs:1:1
|
1 | #![deny(warnings)]
| ^^^^^^^^^^^^^^^^^^
|
= note: inner attributes, like
#![no_std]
, annotate the item enclosing them, and are usually found at the beginning of source files= note: outer attributes, like
#[test]
, annotate the item following themerror: expected item after attributes
--> deny_warnings.rs:1:1
|
1 | #![deny(warnings)]
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: