Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic unit variants are handled incorrectly inside format args #332

Open
dtolnay opened this issue Nov 1, 2024 · 0 comments
Open

Generic unit variants are handled incorrectly inside format args #332

dtolnay opened this issue Nov 1, 2024 · 0 comments

Comments

@dtolnay
Copy link
Owner

dtolnay commented Nov 1, 2024

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

use thiserror::Error;

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

fn main() {
    println!("{}", None::<i32>.is_some());
}
error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, or an operator, found `is_some`
 --> src/main.rs:4:27
  |
4 | #[error("{}", None::<i32>.is_some())]
  |                           ^^^^^^^ expected one of 7 possible tokens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant