PackageTrack
Sign in Get early access

proc-macro-error

Almost drop-in replacement to panics in proc-macros

1.0.4 326M downloads/mo #335 most downloaded on crates.io source

What this package is like to depend on

Last release 6 years ago

no release in 18 months

Release timing varies

gaps range from 1 weeks to 3 months

Most releases are documented

notes for 19 of 31 stable releases

4 versions withdrawn

withdrawn after publishing

7 years old

38 releases · first in 2019

0 releases in the last 12 months

see the full history below

Release timeline

38 releases · Jul 2019 to Jul 2020
2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 38
  1. 1.0.4 31 Jul 2020
    Release notes
    • SpanRange facility is now public.
    • Docs have been improved.
    • Introduced the syn-error feature so you can opt-out from the syn dependency.
    Open source →
  2. 1.0.3 26 Jun 2020
    Release notes
    • Corrected a few typos.
    • Fixed the emit_call_site_warning macro.
    Open source →
  3. 1.0.2 09 Apr 2020
    Release notes
    • An obsolete note was removed from documentation.
    Open source →
  4. 1.0.1 08 Apr 2020
    Release notes
    • proc-macro-hack is now well tested and supported. Not sure about proc-macro-nested, please fill a request if you need it.
    • Fixed emit_call_site_error.
    • Documentation improvements.
    Open source →
  5. 1.0.0 25 Mar 2020
    Release notes

    I believe the API can be considered stable because it's been a few months without breaking changes, and I also don't think this crate will receive much further evolution. It's perfect, admit it.

    Hence, meet the new, stable release!

    Improvements

    • Supported nested #[proc_macro_error] attributes. Well, you aren't supposed to do that, but I caught myself doing it by accident on one occasion and the behavior was... surprising. Better to handle this smooth.
    Open source →
  6. 0.4.12 23 Mar 2020
    Release notes
    • Error message on macros' misuse is now a bit more understandable.
    Open source →
  7. 0.4.11 02 Mar 2020
    Release notes
    • build.rs no longer fails when rustc date could not be determined, (thanks to Fabian Möller for noticing and to Igor Gnatenko for fixing).
    Open source →
  8. 0.4.10 29 Feb 2020
    Release notes
    • proc-macro-error doesn't depend on syn[full] anymore, the compilation is ~30secs faster.
    Open source →
  9. 0.4.9 13 Feb 2020
    Release notes
    • New function: append_dummy.
    Open source →
  10. 0.4.8 01 Feb 2020
    Release notes
    • Support for children messages
    Open source →
  11. 0.4.7 01 Feb 2020
    Release notes
    • Now any type that implements quote::ToTokens can be used instead of spans. This allows for high quality error messages.
    Open source →
  12. 0.4.6 31 Jan 2020
    Release notes
    • From<syn::Error> implementation doesn't lose span info anymore, see #6.
    Open source →
  13. 0.4.5 19 Jan 2020
    Release notes

    Just a small intermediate release.

    • Fix some bugs.
    • Populate license files into subfolders.
    Open source →
  14. 0.4.4 13 Nov 2019
    Release notes
    • Fix abort_if_dirty + warnings bug
    • Allow trailing commas in macros
    Open source →
  15. 0.4.3 07 Nov 2019

    Nothing published for this version

  16. 0.4.1 07 Nov 2019 withdrawn
    Release notes
    • Fixed __pme__suggestions not found bug
    • Documentation improvements, links checked
    Open source →
  17. 0.4.0 06 Nov 2019 withdrawn
    Release notes

    New features

    • "help" messages that can have their own span on nightly, they inherit parent span on stable.
      let cond_help = if condition { Some("some help message") else { None } };
      abort!(
          span, // parent span
          "something's wrong, {} wrongs in total", 10; // main message
          help = "here's a help for you, {}", "take it"; // unconditional help message
          help =? cond_help; // conditional help message, must be Option
          note = note_span => "don't forget the note, {}", "would you?" // notes can have their own span but it's effective only on nightly
      )
      
    • Warnings via emit_warning and emit_warning_call_site. Nightly only, they're ignored on stable.
    • Now proc-macro-error delegates to proc_macro::Diagnostic on nightly.

    Breaking changes

    • MacroError is now replaced by Diagnostic. Its API resembles proc_macro::Diagnostic.
    • Diagnostic does not implement From<&str/String> so Result<T, &str/String>::abort_or_exit() won't work anymore (nobody used it anyway).
    • macro_error! macro is replaced with diagnostic!.

    Improvements

    • Now proc-macro-error renders notes exactly just like rustc does.
    • We don't parse a body of a function annotated with #[proc_macro_error] anymore, only looking at the signature. This should somewhat decrease expansion time for large functions.
    Open source →
  18. 0.3.4 20 Oct 2019

    Nothing published for this version

  19. 0.3.3 16 Oct 2019
    Release notes
    • Now you can use any word instead of "help", undocumented.
    Open source →
  20. 0.3.2 16 Oct 2019
    Release notes
    • Introduced support for "help" messages, undocumented.
    Open source →
  21. 0.3.1 08 Oct 2019

    Nothing published for this version

  22. 0.3.0 08 Oct 2019
    Release notes

    The crate has been completely rewritten from scratch!

    Changes (most are breaking):

    • Renamed macros:
      • span_error => abort
      • call_site_error => abort_call_site
    • filter_macro_errors was replaced by #[proc_macro_error] attribute.
    • set_dummy now takes TokenStream instead of Option<TokenStream>
    • Support for multiple errors via emit_error and emit_call_site_error
    • New macro_error macro for building errors in format=like style.
    • MacroError API had been reconsidered. It also now implements quote::ToTokens.
    Open source →
  23. 0.3.0-rc1 06 Oct 2019 pre-release

    Nothing published for this version

  24. 0.3.0-rc.1 07 Oct 2019 pre-release

    Nothing published for this version

  25. 0.2.6 02 Sep 2019
    Release notes
    • Introduce support for dummy implementations via dummy::set_dummy
    • multi::* is now deprecated, will be completely rewritten in v0.3
    Open source →
  26. 0.2.5 02 Sep 2019 withdrawn

    Nothing published for this version

  27. 0.2.4 20 Aug 2019

    Nothing published for this version

  28. 0.2.3 16 Aug 2019

    Nothing published for this version

  29. 0.2.2 15 Aug 2019

    Nothing published for this version

  30. 0.2.1 15 Aug 2019 withdrawn

    Nothing published for this version

  31. 0.2.0 15 Aug 2019
    Release notes

    Breaking changes

    • trigger_error replaced with MacroError::trigger and filter_macro_error_panics is hidden from docs. This is not quite a breaking change since users weren't supposed to use these functions directly anyway.
    • All dependencies are updated to v1.*.

    New features

    • Ability to stack multiple errors via multi::MultiMacroErrors and emit them at once.

    Improvements

    • Now MacroError implements std::fmt::Display instead of std::string::ToString.
    • MacroError::span inherent method.
    • From<MacroError> for proc_macro/proc_macro2::TokenStream implementations.
    • AsRef/AsMut<String> for MacroError implementations.
    Open source →
  32. 0.1.5 19 Jul 2019

    Nothing published for this version

  33. 0.1.4 19 Jul 2019

    Nothing published for this version

  34. 0.1.3 12 Jul 2019

    Nothing published for this version

  35. 0.1.2 12 Jul 2019

    Nothing published for this version

  36. 0.1.2-docfix 12 Jul 2019 pre-release

    Nothing published for this version

  37. 0.1.1 12 Jul 2019

    Nothing published for this version

  38. 0.1.0 11 Jul 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive