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

Flag to disable auto-detected source #99

Open
webmaster128 opened this issue Sep 21, 2020 · 0 comments
Open

Flag to disable auto-detected source #99

webmaster128 opened this issue Sep 21, 2020 · 0 comments

Comments

@webmaster128
Copy link

I have an error enum that I want to convert from snafu to thiserror with the following case:

    #[error("Error serializing type {source}: {msg}")]
    SerializeErr {
        /// the source type that was attempted
        source: String,
        msg: String,
        #[cfg(feature = "backtraces")]
        backtrace: Backtrace,
    },

It looks the field source gets some unintended special treatment such that my code does not compile. Renaming the field solves the problem. But can this be sone without changing the field name?

Is it possible to do something like #[snafu(source(false))]? I tried using #[source(false)] but this causes my error to not derive Display anymore. Is the use of #[source(false)] correct? I did not see it in documentation.

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