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

snafu-derive 0.4.2 broke #[doc(hidden)] #139

Closed
jgallagher opened this issue Aug 7, 2019 · 8 comments
Closed

snafu-derive 0.4.2 broke #[doc(hidden)] #139

jgallagher opened this issue Aug 7, 2019 · 8 comments
Labels
bug Something isn't working found in the field A user of SNAFU found this when trying to use it good first issue Good for newcomers

Comments

@jgallagher
Copy link

Hi - big fan of snafu! I have a crate that depends on it, and it looks like I'm getting bit by a backwards-incompatible change in a patch release in snafu (amiquip/amiquip#12). Specifically, this code compiles if I download snafu 0.4.1 and change its snafu-derive dependency to "=0.4.1", but breaks if it's "0.4.1" (the published value) or "=0.4.2".

I looked at the issues and didn't see anyone else mention this, so maybe I'm the only one that got bit by it. I'm about to publish a patch release that just removes the #[doc(hidden)] attribute for now, but I am curious if it's still possible to include it somehow with 0.4.3.

@mikeando
Copy link

mikeando commented Aug 7, 2019

Hi John,

Can I suggest that you create a minimal reproducer - I think it would be trivial, but I've not got rust available at the moment, so can't whip one up myself.

That way there will be something simple for developers to turn into a real test and work out where to go from there.

@jgallagher
Copy link
Author

Sure, although it's basically just what I linked to:

#[derive(Debug, Snafu)]
enum Error {
    #[doc(hidden)]
    #[snafu(display("demo"))]
    Demo,
}

does not compile with any currently-published version of snafu 0.4.x, but did compile on 0.4.1 before 0.4.2 was published.

@shepmaster shepmaster added bug Something isn't working found in the field A user of SNAFU found this when trying to use it good first issue Good for newcomers help wanted Extra attention is needed labels Aug 7, 2019
@shepmaster
Copy link
Owner

I have a hunch that this is due to #107, specifically in this code.

One "tricky" thing about this patch is that we have some backwards incompatible changes brewing in master. However, #136 also is ready to go, so I might need to set up a branch for 0.4 and land both this fix and that enhancement for 0.4.4.

@shepmaster
Copy link
Owner

It would be good for you to show the error message that you get. This ensures that what we reproduce matches your behavior.

@shepmaster
Copy link
Owner

@jgallagher do you think you can test your local code with #143? I believe that will fix it.

@shepmaster
Copy link
Owner

Released as SNAFU 0.4.4

@jgallagher
Copy link
Author

@shepmaster Sorry for the delay, can't usually respond during the day. Yep, this did fix it. The error I was getting was

error: expected `=`
 --> src/main.rs:5:10
  |
5 |     #[doc(hidden)]
  |          ^^^^^^^^

error: aborting due to previous error

Thanks for the super fast fix!

@shepmaster
Copy link
Owner

No worries; sorry for any trouble we caused!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working found in the field A user of SNAFU found this when trying to use it good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants