dtolnay / dtolnay/thiserror

Generic unit variants are handled incorrectly inside format args

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

Description

The following is a valid format expression, but thiserror fails to compile it.

```rust
use thiserror::Error;

#[derive(Debug, Error)]
#[error("{}", None::.is_some())]
pub struct Error;

fn main() {
println!("{}", None::.is_some());
}
```

```console
error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, or an operator, found `is_some`
--> src/main.rs:4:27
|
4 | #[error("{}", None::.is_some())]
| ^^^^^^^ expected one of 7 possible tokens
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.