proc-macro-error-attr
Attribute macro for proc-macro-error crate
1.0.4
325M downloads/mo
#338 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
Nearly every release is documented
notes for 18 of 20 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
22 releases · first in 2019
0 releases in the last 12 months
see the full history below
Release timeline
22 releases · Oct 2019 to Jul 2020Releases
latest 22-
1.0.431 Jul 2020Release notes
Open source →SpanRangefacility is now public.- Docs have been improved.
- Introduced the
syn-errorfeature so you can opt-out from thesyndependency.
-
1.0.326 Jun 2020 -
1.0.209 Apr 2020 -
1.0.108 Apr 2020Release notes
Open source →proc-macro-hackis now well tested and supported. Not sure aboutproc-macro-nested, please fill a request if you need it.- Fixed
emit_call_site_error. - Documentation improvements.
-
1.0.025 Mar 2020Release notes
Open source →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.
- Supported nested
-
0.4.1223 Mar 2020 -
0.4.1102 Mar 2020Release notes
Open source →build.rsno longer fails whenrustcdate could not be determined, (thanks toFabian Möllerfor noticing and toIgor Gnatenkofor fixing).
-
0.4.1029 Feb 2020Release notes
Open source →proc-macro-errordoesn't depend on syn[full] anymore, the compilation is ~30secs faster.
-
0.4.913 Feb 2020 -
0.4.801 Feb 2020 -
0.4.701 Feb 2020Release notes
Open source →- Now any type that implements
quote::ToTokenscan be used instead of spans. This allows for high quality error messages.
- Now any type that implements
-
0.4.631 Jan 2020 -
0.4.519 Jan 2020Release notes
Open source →Just a small intermediate release.
- Fix some bugs.
- Populate license files into subfolders.
-
0.4.307 Nov 2019Nothing published for this version
-
0.4.107 Nov 2019Release notes
Open source →- Fixed
__pme__suggestions not foundbug - Documentation improvements, links checked
- Fixed
-
0.4.006 Nov 2019Release notes
Open source →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_warningandemit_warning_call_site. Nightly only, they're ignored on stable. - Now
proc-macro-errordelegates toproc_macro::Diagnosticon nightly.
Breaking changes
MacroErroris now replaced byDiagnostic. Its API resemblesproc_macro::Diagnostic.Diagnosticdoes not implementFrom<&str/String>soResult<T, &str/String>::abort_or_exit()won't work anymore (nobody used it anyway).macro_error!macro is replaced withdiagnostic!.
Improvements
- Now
proc-macro-errorrenders 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.
- "help" messages that can have their own span on nightly, they
inherit parent span on stable.
-
0.3.420 Oct 2019Nothing published for this version
-
0.3.316 Oct 2019 -
0.3.216 Oct 2019 -
0.3.008 Oct 2019Release notes
Open source →The crate has been completely rewritten from scratch!
Changes (most are breaking):
- Renamed macros:
span_error=>abortcall_site_error=>abort_call_site
filter_macro_errorswas replaced by#[proc_macro_error]attribute.set_dummynow takesTokenStreaminstead ofOption<TokenStream>- Support for multiple errors via
emit_errorandemit_call_site_error - New
macro_errormacro for building errors in format=like style. MacroErrorAPI had been reconsidered. It also now implementsquote::ToTokens.
- Renamed macros:
-
0.3.0-rc106 Oct 2019 pre-releaseNothing published for this version
-
0.3.0-rc.107 Oct 2019 pre-releaseNothing published for this version