Skip to content

Commit

Permalink
add test case for #89566
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Dec 2, 2023
1 parent 6a9456f commit 42ef84c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// run-rustfix

#[derive(Debug)] //~ ERROR `derive` attribute cannot be used at crate level
struct Test {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// run-rustfix

#![derive(Debug)] //~ ERROR `derive` attribute cannot be used at crate level
struct Test {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: `derive` attribute cannot be used at crate level
--> $DIR/issue-89566-suggest-fix-invalid-top-level-macro-attr.rs:3:1
|
LL | #![derive(Debug)]
| ^^^^^^^^^^^^^^^^^
|
help: perhaps you meant to use an outer attribute
|
LL - #![derive(Debug)]
LL + #[derive(Debug)]
|

error: aborting due to 1 previous error

0 comments on commit 42ef84c

Please sign in to comment.