Add ui test of duplicate generics in remote derive
This commit is contained in:
parent
0daafe423f
commit
c4f67e679f
17
test_suite/tests/ui/remote/double_generic.rs
Normal file
17
test_suite/tests/ui/remote/double_generic.rs
Normal file
@ -0,0 +1,17 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
|
||||
mod remote {
|
||||
pub struct Struct<T, U> {
|
||||
pub t: T,
|
||||
pub u: U,
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(remote = "remote::StructGeneric<u8>")]
|
||||
struct StructDef<U> {
|
||||
t: u8,
|
||||
u: U,
|
||||
}
|
||||
|
||||
fn main() {}
|
52
test_suite/tests/ui/remote/double_generic.stderr
Normal file
52
test_suite/tests/ui/remote/double_generic.stderr
Normal file
@ -0,0 +1,52 @@
|
||||
error: expected one of `:`, `@`, or `|`, found `>`
|
||||
--> tests/ui/remote/double_generic.rs:12:19
|
||||
|
|
||||
12 | struct StructDef<U> {
|
||||
| ^ expected one of `:`, `@`, or `|`
|
||||
|
||||
error: expected one of `!`, `)`, `,`, or `::`, found `<`
|
||||
--> tests/ui/remote/double_generic.rs:12:17
|
||||
|
|
||||
11 | #[serde(remote = "remote::StructGeneric<u8>")]
|
||||
| -
|
||||
| |
|
||||
| expected one of `!`, `)`, `,`, or `::`
|
||||
| help: missing `,`
|
||||
12 | struct StructDef<U> {
|
||||
| ^ unexpected token
|
||||
|
||||
error: proc-macro derive produced unparseable tokens
|
||||
--> tests/ui/remote/double_generic.rs:10:10
|
||||
|
|
||||
10 | #[derive(Serialize, Deserialize)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error: expected one of `!`, `+`, `,`, `::`, or `>`, found `<`
|
||||
--> tests/ui/remote/double_generic.rs:12:17
|
||||
|
|
||||
10 | #[derive(Serialize, Deserialize)]
|
||||
| -----------
|
||||
| |
|
||||
| while parsing this item list starting here
|
||||
| the item list ends here
|
||||
11 | #[serde(remote = "remote::StructGeneric<u8>")]
|
||||
| - expected one of `!`, `+`, `,`, `::`, or `>`
|
||||
12 | struct StructDef<U> {
|
||||
| ^ unexpected token
|
||||
|
|
||||
help: you might have meant to end the type parameters here
|
||||
|
|
||||
11 | #[serde(remote = "remote::StructGeneric<u8>">)]
|
||||
| +
|
||||
|
||||
error: proc-macro derive produced unparseable tokens
|
||||
--> tests/ui/remote/double_generic.rs:10:21
|
||||
|
|
||||
10 | #[derive(Serialize, Deserialize)]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0412]: cannot find type `StructGeneric` in module `remote`
|
||||
--> tests/ui/remote/double_generic.rs:11:18
|
||||
|
|
||||
11 | #[serde(remote = "remote::StructGeneric<u8>")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `remote`
|
Loading…
Reference in New Issue
Block a user