Haibo Huang | eef7c23 | 2020-09-29 11:19:51 -0700 | [diff] [blame] | 1 | # v1.0.4 (2020-7-31) |
| 2 | |
| 3 | * `SpanRange` facility is now public. |
| 4 | * Docs have been improved. |
| 5 | * Introduced the `syn-error` feature so you can opt-out from the `syn` dependency. |
| 6 | |
| 7 | # v1.0.3 (2020-6-26) |
| 8 | |
| 9 | * Corrected a few typos. |
| 10 | * Fixed the `emit_call_site_warning` macro. |
| 11 | |
Matthew Maurer | b26ed88 | 2020-06-02 11:15:09 -0700 | [diff] [blame] | 12 | # v1.0.2 (2020-4-9) |
| 13 | |
| 14 | * An obsolete note was removed from documentation. |
| 15 | |
| 16 | # v1.0.1 (2020-4-9) |
| 17 | |
| 18 | * `proc-macro-hack` is now well tested and supported. Not sure about `proc-macro-nested`, |
| 19 | please fill a request if you need it. |
| 20 | * Fixed `emit_call_site_error`. |
| 21 | * Documentation improvements. |
| 22 | |
| 23 | # v1.0.0 (2020-3-25) |
| 24 | |
| 25 | I believe the API can be considered stable because it's been a few months without |
| 26 | breaking changes, and I also don't think this crate will receive much further evolution. |
| 27 | It's perfect, admit it. |
| 28 | |
| 29 | Hence, meet the new, stable release! |
| 30 | |
| 31 | ### Improvements |
| 32 | |
| 33 | * Supported nested `#[proc_macro_error]` attributes. Well, you aren't supposed to do that, |
| 34 | but I caught myself doing it by accident on one occasion and the behavior was... surprising. |
| 35 | Better to handle this smooth. |
| 36 | |
| 37 | # v0.4.12 (2020-3-23) |
| 38 | |
| 39 | * Error message on macros' misuse is now a bit more understandable. |
| 40 | |
| 41 | # v0.4.11 (2020-3-02) |
| 42 | |
| 43 | * `build.rs` no longer fails when `rustc` date could not be determined, |
| 44 | (thanks to [`Fabian Möller`](https://gitlab.com/CreepySkeleton/proc-macro-error/issues/8) |
| 45 | for noticing and to [`Igor Gnatenko`](https://gitlab.com/CreepySkeleton/proc-macro-error/-/merge_requests/25) |
| 46 | for fixing). |
| 47 | |
| 48 | # v0.4.10 (2020-2-29) |
| 49 | |
| 50 | * `proc-macro-error` doesn't depend on syn\[full\] anymore, the compilation |
| 51 | is \~30secs faster. |
| 52 | |
| 53 | # v0.4.9 (2020-2-13) |
| 54 | |
| 55 | * New function: `append_dummy`. |
| 56 | |
| 57 | # v0.4.8 (2020-2-01) |
| 58 | |
| 59 | * Support for children messages |
| 60 | |
| 61 | # v0.4.7 (2020-1-31) |
| 62 | |
| 63 | * Now any type that implements `quote::ToTokens` can be used instead of spans. |
| 64 | This allows for high quality error messages. |
| 65 | |
| 66 | # v0.4.6 (2020-1-31) |
| 67 | |
| 68 | * `From<syn::Error>` implementation doesn't lose span info anymore, see |
| 69 | [#6](https://gitlab.com/CreepySkeleton/proc-macro-error/issues/6). |
| 70 | |
| 71 | # v0.4.5 (2020-1-20) |
| 72 | Just a small intermediate release. |
| 73 | |
| 74 | * Fix some bugs. |
| 75 | * Populate license files into subfolders. |
| 76 | |
| 77 | # v0.4.4 (2019-11-13) |
| 78 | * Fix `abort_if_dirty` + warnings bug |
| 79 | * Allow trailing commas in macros |
| 80 | |
| 81 | # v0.4.2 (2019-11-7) |
| 82 | * FINALLY fixed `__pme__suggestions not found` bug |
| 83 | |
| 84 | # v0.4.1 (2019-11-7) YANKED |
| 85 | * Fixed `__pme__suggestions not found` bug |
| 86 | * Documentation improvements, links checked |
| 87 | |
| 88 | # v0.4.0 (2019-11-6) YANKED |
| 89 | |
| 90 | ## New features |
| 91 | * "help" messages that can have their own span on nightly, they |
| 92 | inherit parent span on stable. |
| 93 | ```rust |
| 94 | let cond_help = if condition { Some("some help message") else { None } }; |
| 95 | abort!( |
| 96 | span, // parent span |
| 97 | "something's wrong, {} wrongs in total", 10; // main message |
| 98 | help = "here's a help for you, {}", "take it"; // unconditional help message |
| 99 | help =? cond_help; // conditional help message, must be Option |
| 100 | note = note_span => "don't forget the note, {}", "would you?" // notes can have their own span but it's effective only on nightly |
| 101 | ) |
| 102 | ``` |
| 103 | * Warnings via `emit_warning` and `emit_warning_call_site`. Nightly only, they're ignored on stable. |
| 104 | * Now `proc-macro-error` delegates to `proc_macro::Diagnostic` on nightly. |
| 105 | |
| 106 | ## Breaking changes |
| 107 | * `MacroError` is now replaced by `Diagnostic`. Its API resembles `proc_macro::Diagnostic`. |
| 108 | * `Diagnostic` does not implement `From<&str/String>` so `Result<T, &str/String>::abort_or_exit()` |
| 109 | won't work anymore (nobody used it anyway). |
| 110 | * `macro_error!` macro is replaced with `diagnostic!`. |
| 111 | |
| 112 | ## Improvements |
| 113 | * Now `proc-macro-error` renders notes exactly just like rustc does. |
| 114 | * We don't parse a body of a function annotated with `#[proc_macro_error]` anymore, |
| 115 | only looking at the signature. This should somewhat decrease expansion time for large functions. |
| 116 | |
| 117 | # v0.3.3 (2019-10-16) |
| 118 | * Now you can use any word instead of "help", undocumented. |
| 119 | |
| 120 | # v0.3.2 (2019-10-16) |
| 121 | * Introduced support for "help" messages, undocumented. |
| 122 | |
| 123 | # v0.3.0 (2019-10-8) |
| 124 | |
| 125 | ## The crate has been completely rewritten from scratch! |
| 126 | |
| 127 | ## Changes (most are breaking): |
| 128 | * Renamed macros: |
| 129 | * `span_error` => `abort` |
| 130 | * `call_site_error` => `abort_call_site` |
| 131 | * `filter_macro_errors` was replaced by `#[proc_macro_error]` attribute. |
| 132 | * `set_dummy` now takes `TokenStream` instead of `Option<TokenStream>` |
| 133 | * Support for multiple errors via `emit_error` and `emit_call_site_error` |
| 134 | * New `macro_error` macro for building errors in format=like style. |
| 135 | * `MacroError` API had been reconsidered. It also now implements `quote::ToTokens`. |
| 136 | |
| 137 | # v0.2.6 (2019-09-02) |
| 138 | * Introduce support for dummy implementations via `dummy::set_dummy` |
| 139 | * `multi::*` is now deprecated, will be completely rewritten in v0.3 |
| 140 | |
| 141 | # v0.2.0 (2019-08-15) |
| 142 | |
| 143 | ## Breaking changes |
| 144 | * `trigger_error` replaced with `MacroError::trigger` and `filter_macro_error_panics` |
| 145 | is hidden from docs. |
| 146 | This is not quite a breaking change since users weren't supposed to use these functions directly anyway. |
| 147 | * All dependencies are updated to `v1.*`. |
| 148 | |
| 149 | ## New features |
| 150 | * Ability to stack multiple errors via `multi::MultiMacroErrors` and emit them at once. |
| 151 | |
| 152 | ## Improvements |
| 153 | * Now `MacroError` implements `std::fmt::Display` instead of `std::string::ToString`. |
| 154 | * `MacroError::span` inherent method. |
| 155 | * `From<MacroError> for proc_macro/proc_macro2::TokenStream` implementations. |
| 156 | * `AsRef/AsMut<String> for MacroError` implementations. |
| 157 | |
| 158 | # v0.1.x (2019-07-XX) |
| 159 | |
| 160 | ## New features |
| 161 | * An easy way to report errors inside within a proc-macro via `span_error`, |
| 162 | `call_site_error` and `filter_macro_errors`. |