Merge pull request #13657 from jdonszelmann/disallowed-macros-to-early

collect attribute spans early for disallowed macros
This commit is contained in:
Philipp Krones 2024-11-07 19:23:20 +00:00 committed by GitHub
commit f712eb5cdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 38 deletions

View file

@ -1,11 +1,39 @@
error: use of a disallowed macro `std::vec`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:16:5
|
LL | vec![1, 2, 3];
| ^^^^^^^^^^^^^
|
= note: `-D clippy::disallowed-macros` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::disallowed_macros)]`
error: use of a disallowed macro `serde::Serialize`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:18:14
|
LL | #[derive(Serialize)]
| ^^^^^^^^^
|
= note: no serializing
error: use of a disallowed macro `macros::attr`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:31:1
|
LL | / macros::attr! {
LL | | struct S;
LL | | }
| |_^
error: use of a disallowed macro `proc_macros::Derive`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:47:10
|
LL | #[derive(Derive)]
| ^^^^^^
error: use of a disallowed macro `std::println`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:13:5
|
LL | println!("one");
| ^^^^^^^^^^^^^^^
|
= note: `-D clippy::disallowed-macros` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::disallowed_macros)]`
error: use of a disallowed macro `std::println`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:14:5
@ -19,20 +47,6 @@ error: use of a disallowed macro `std::cfg`
LL | cfg!(unix);
| ^^^^^^^^^^
error: use of a disallowed macro `std::vec`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:16:5
|
LL | vec![1, 2, 3];
| ^^^^^^^^^^^^^
error: use of a disallowed macro `serde::Serialize`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:18:14
|
LL | #[derive(Serialize)]
| ^^^^^^^^^
|
= note: no serializing
error: use of a disallowed macro `macros::expr`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:21:13
|
@ -69,14 +83,6 @@ error: use of a disallowed macro `macros::binop`
LL | let _ = macros::binop!(1);
| ^^^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::attr`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:31:1
|
LL | / macros::attr! {
LL | | struct S;
LL | | }
| |_^
error: use of a disallowed macro `macros::item`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:36:5
|
@ -95,11 +101,5 @@ error: use of a disallowed macro `macros::item`
LL | macros::item!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `proc_macros::Derive`
--> tests/ui-toml/disallowed_macros/disallowed_macros.rs:47:10
|
LL | #[derive(Derive)]
| ^^^^^^
error: aborting due to 16 previous errors