Skip to content

Commit d21bc65

Browse files
committed
Add test for rust-lang#97343
1 parent b2c9872 commit d21bc65

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/test/ui/derives/issue-97343.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use std::fmt::Debug;
2+
3+
#[derive(Debug)] //~ ERROR expected struct, variant or union type, found type parameter `Irrelevant`
4+
pub struct Irrelevant<Irrelevant> { //~ ERROR type arguments are not allowed for this type
5+
irrelevant: Irrelevant,
6+
}
7+
8+
fn main() {}
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0574]: expected struct, variant or union type, found type parameter `Irrelevant`
2+
--> $DIR/issue-97343.rs:3:10
3+
|
4+
LL | #[derive(Debug)]
5+
| ^^^^^ not a struct, variant or union type
6+
|
7+
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
8+
9+
error[E0109]: type arguments are not allowed for this type
10+
--> $DIR/issue-97343.rs:4:23
11+
|
12+
LL | #[derive(Debug)]
13+
| ----- in this derive macro expansion
14+
LL | pub struct Irrelevant<Irrelevant> {
15+
| ^^^^^^^^^^ type argument not allowed
16+
|
17+
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
18+
19+
error: aborting due to 2 previous errors
20+
21+
Some errors have detailed explanations: E0109, E0574.
22+
For more information about an error, try `rustc --explain E0109`.

0 commit comments

Comments
 (0)