google / google/argh

Proc-macro derive produced unparseable tokens

Open
#88 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
102
PR merge metrics
No merged PRs in 30d

Description

This is the code I am using ([full link](https://git.cryptid.cc/lost/cmg/src/commit/cc271fd278895a904c4ba71debdc8e78f0a1fe25/src/cli.rs)):
```rust
#[derive(FromArgs, PartialEq, Debug)]
#[argh(
description = "used to search for crackmes (WARNING: Only gets first page of results)",
subcommand,
name = "search"
)]
pub struct SearchArgs {
#[argh(
description = "the range of difficulty (i.e. 1..6)",
from_str_fn(range_parser),
option,
default = "(1, 6)"
)]
pub difficulty: (u8, u8),

#[argh(
description = "the range of quality (i.e. 1..6)",
from_str_fn(range_parser),
option,
default = "(1, 6)"
)]
pub quality: (u8, u8),

#[argh(description = "name of crackme", option, default = "")]
pub name: String,

#[argh(description = "name of crackme's author", option, default = "")]
pub author: String,

#[argh(description = "language of crackme", option)]
pub language: Option,

#[argh(description = "platform of crackme", option)]
pub platform: Option,
}
```
Errors:
```
error: expected expression, found `)`
--> src/cli.rs:18:10
|
18 | #[derive(FromArgs, PartialEq, Debug)]
| ^^^^^^^^
| |
| expected expression
| while parsing this struct
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: proc-macro derive produced unparseable tokens
--> src/cli.rs:18:10
|
18 | #[derive(FromArgs, PartialEq, Debug)]
| ^^^^^^^^
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.