Skip to content

Commit 42ef84c

Browse files
committed
add test case for #89566
1 parent 6a9456f commit 42ef84c

3 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// run-rustfix
2+
3+
#[derive(Debug)] //~ ERROR `derive` attribute cannot be used at crate level
4+
struct Test {}
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// run-rustfix
2+
3+
#![derive(Debug)] //~ ERROR `derive` attribute cannot be used at crate level
4+
struct Test {}
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: `derive` attribute cannot be used at crate level
2+
--> $DIR/issue-89566-suggest-fix-invalid-top-level-macro-attr.rs:3:1
3+
|
4+
LL | #![derive(Debug)]
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
help: perhaps you meant to use an outer attribute
8+
|
9+
LL - #![derive(Debug)]
10+
LL + #[derive(Debug)]
11+
|
12+
13+
error: aborting due to 1 previous error
14+

0 commit comments

Comments
 (0)