Skip to content

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

@zachs18

Description

@zachs18
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions