SNAFU 0.5.0 Released

I'm excited to announce that we released SNAFU 0.5.0 today. The biggest user-facing change is that more usages of SNAFU will now cause the compiler to fail! :smiling_imp:

Of course, what I really mean is that error-reporting has been greatly improved for incorrect usages of the SNAFU attributes. This has all been driven by a new contributor, tjkirch. They started innocently enough, chiming in on an issue. Some back-and-forth showed that SNAFU wasn't reporting a misused attribute. Shortly thereafter, they took on the job of improving the messages and then submitted a plethora of pull requests to fix things.

I'd like to heartily thank tjkirch for their contributions; working with them has been a breeze, and I hope that other people will have the pleasure of working with them in the future!

Other highlights

Since the previous post on 0.2.1:

  • #[snafu(source(from))] can be used to perform transformations of the error type.
  • #[snafu(source)] and #[snafu(backtrace)] can be used to mark fields as a source or backtrace, if they aren't automatically detected (or not use them if they've been mistakenly detected).
  • Support for futures 0.1, standard library futures, and futures 0.3 has been added.
  • Documentation comments are used as default Display implementations.
  • The default Display implementation includes the underlying cause.


Since 0.2.1, the following excellent human beings have contributed code:

What's next?

The top-of-mind things we are looking at for 0.6:

  • Better support for environments without the standard library.
  • End-user control of whether backtraces are enabled or not.
  • Upgrading syn/quote/proc-macro2 to 1.x versions and requiring Rust 1.31+.

Please come participate if you are interested in these or other topics!


Thanks @shepmaster!

I wanted to chime in and recommend SNAFU as a great library. I think it's the next generation of Rust error handling, and it addressed a lot of problems for me. I wouldn't have gotten as far as contributing if I didn't love using it.

I also want to recommend SNAFU as a wonderful project for other contributors. You get to work with @shepmaster! They gave great guidance and encouragement the whole way, and it inspired me to keep making improvements. I learned a lot.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.