dtolnay / dtolnay/monostate

Can't use on struct with type parameter

Open
#6 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
285
Forks
9
PR merge metrics
No merged PRs in 30d

Description

```rust
#[derive(Debug, Deserialize)]
struct RpcResponse {
jsonrpc: MustBe!("2.0"),
id: usize,
result: RS,
}
```

generates error:
`derive` cannot be used on items with type macros

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported derive invocation with the generic RpcResponse example and inspect where the `derive` cannot be used on items with type macros error is emitted. Done means the shown generic struct can derive Deserialize while retaining the MustBe!("2.0") field constraint.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.