Rollup merge of #150127 - Bryntet:parse_rustc_lint_untracked_query_information, r=JonathanBrouwer

Port `#[rustc_lint_untracked_query_information]` and `#[rustc_lint_diagnostics]` to using attribute parsers

r? ``@JonathanBrouwer``
This commit is contained in:
Matthias Krüger
2025-12-19 09:25:26 +01:00
committed by GitHub
10 changed files with 67 additions and 59 deletions
@@ -3,7 +3,7 @@
#![feature(rustc_attrs)]
#[rustc_lint_diagnostics]
//~^ ERROR attribute should be applied to a function
//~^ ERROR `#[rustc_lint_diagnostics]` attribute cannot be used on structs
struct Foo;
impl Foo {
@@ -1,17 +1,20 @@
error: malformed `rustc_lint_diagnostics` attribute input
--> $DIR/diagnostics_incorrect.rs:10:5
|
LL | #[rustc_lint_diagnostics(a)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_lint_diagnostics]`
error: attribute should be applied to a function definition
error: `#[rustc_lint_diagnostics]` attribute cannot be used on structs
--> $DIR/diagnostics_incorrect.rs:5:1
|
LL | #[rustc_lint_diagnostics]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
LL |
LL | struct Foo;
| ----------- not a function definition
|
= help: `#[rustc_lint_diagnostics]` can only be applied to functions
error[E0565]: malformed `rustc_lint_diagnostics` attribute input
--> $DIR/diagnostics_incorrect.rs:10:5
|
LL | #[rustc_lint_diagnostics(a)]
| ^^^^^^^^^^^^^^^^^^^^^^^^---^
| | |
| | didn't expect any arguments here
| help: must be of the form: `#[rustc_lint_diagnostics]`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0565`.