forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#69522 - Centril:fix-69341, r=petrochenkov
error_derive_forbidden_on_non_adt: be more graceful Fixes rust-lang#69341 which was injected by rust-lang#67052. r? @petrochenkov
- Loading branch information
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/test/ui/malformed/issue-69341-malformed-derive-inert.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fn main() {} | ||
|
||
struct CLI { | ||
#[derive(parse())] | ||
//~^ ERROR traits in `#[derive(...)]` don't accept arguments | ||
//~| ERROR cannot find derive macro `parse` in this scope | ||
//~| ERROR cannot find derive macro `parse` in this scope | ||
path: (), | ||
//~^ ERROR `derive` may only be applied to structs, enums and unions | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: traits in `#[derive(...)]` don't accept arguments | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:4:19 | ||
| | ||
LL | #[derive(parse())] | ||
| ^^ help: remove the arguments | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:8:5 | ||
| | ||
LL | path: (), | ||
| ^^^^^^^^ | ||
|
||
error: cannot find derive macro `parse` in this scope | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:4:14 | ||
| | ||
LL | #[derive(parse())] | ||
| ^^^^^ | ||
|
||
error: cannot find derive macro `parse` in this scope | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:4:14 | ||
| | ||
LL | #[derive(parse())] | ||
| ^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|