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

derive(Error) hangs on invalid input in #[error] helper attribute #381

Closed
zachs18 opened this issue Nov 10, 2024 · 1 comment · Fixed by #382
Closed

derive(Error) hangs on invalid input in #[error] helper attribute #381

zachs18 opened this issue Nov 10, 2024 · 1 comment · Fixed by #382

Comments

@zachs18
Copy link

zachs18 commented Nov 10, 2024

use thiserror::Error;

#[derive(Error, Debug)]
pub enum ArgError {
    #[error("".yellow)]
    InvalidUrl,
}

causes the compiler to hang.

Specifically, it seems like this while loop https://github.com/dtolnay/thiserror/blob/master/impl/src/fmt.rs#L218-L229 is infinite if the input is not as expected; the if statement is skipped and input never changes, so the if statement is forever skipped.

@dtolnay
Copy link
Owner

dtolnay commented Nov 10, 2024

Fixed in 2.0.2.

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

Successfully merging a pull request may close this issue.

2 participants