type_length_limit is inconsistently warned about with incremental · Issue #87384 · rust-lang/rust (original) (raw)
I have this library crate:
#![type_length_limit = "95595489"]
pub fn main() { println!("Hello, world!"); }
When I build it with 1.55.0-nightly (27277d966 2021-07-16)
I get no warnings.
When I try to perform edition migrations with it by running cargo +nightly fix --edition
, I get warnings:
Migrating src/lib.rs from 2018 edition to 2021
warning: unused attribute
--> src/lib.rs:1:1
|
1 | #![type_length_limit = "95595489"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_attributes)]` on by default
warning: crate-level attribute should be in the root module
--> src/lib.rs:1:1
|
1 | #![type_length_limit = "95595489"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: 2 warnings emitted
As far as I know, this attribute is valid and has effect where it currently is, and either the 2021 edition migration is slightly broken, the 2021 edition has changed the behaviour of this attribute in a way I haven't seen documented.
rustc --version --verbose
:
rustc 1.55.0-nightly (b41936b92 2021-07-20)
binary: rustc
commit-hash: b41936b92cd8463020207cb2f62a4247942ef2e4
commit-date: 2021-07-20
host: x86_64-apple-darwin
release: 1.55.0-nightly
LLVM version: 12.0.1