diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e8fefb..2a579450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Merge fns `DrawCx::text_effects` and `text` (#458) - Remove feature `min_spec` (#458) +- Use `proc-macro-error2` (#459) ## [0.15.0] — 2024-12-02 diff --git a/crates/kas-macros/Cargo.toml b/crates/kas-macros/Cargo.toml index 210edfed..dc3c81f3 100644 --- a/crates/kas-macros/Cargo.toml +++ b/crates/kas-macros/Cargo.toml @@ -25,11 +25,11 @@ recursive-layout-widgets = [] [dependencies] quote = "1.0" proc-macro2 = { version = "1.0" } -proc-macro-error = "1.0" +proc-macro-error2 = { version = "2.0", default-features = false } bitflags = "2.3.3" [dependencies.impl-tools-lib] -version = "0.10.0" # version used in doc links +version = "0.11.0" # version used in doc links [dependencies.syn] version = "2.0.22" diff --git a/crates/kas-macros/src/lib.rs b/crates/kas-macros/src/lib.rs index 003b9a97..26ef061d 100644 --- a/crates/kas-macros/src/lib.rs +++ b/crates/kas-macros/src/lib.rs @@ -11,7 +11,7 @@ extern crate proc_macro; use impl_tools_lib::{anon, autoimpl, scope}; use proc_macro::TokenStream; -use proc_macro_error::{emit_call_site_error, proc_macro_error}; +use proc_macro_error2::{emit_call_site_error, emit_error, proc_macro_error}; use syn::parse_macro_input; use syn::spanned::Spanned; @@ -394,7 +394,7 @@ pub fn impl_anon(input: TokenStream) -> TokenStream { // We can't test since Span::eq is unstable! field.ty.span() }; - proc_macro_error::emit_error!(span, "expected `: TYPE`"); + emit_error!(span, "expected `: TYPE`"); } } let mut scope = input.into_scope(); diff --git a/crates/kas-macros/src/make_layout.rs b/crates/kas-macros/src/make_layout.rs index 7ffb9204..e0b4c836 100644 --- a/crates/kas-macros/src/make_layout.rs +++ b/crates/kas-macros/src/make_layout.rs @@ -6,7 +6,7 @@ use crate::collection::{CellInfo, GridDimensions, NameGenerator, StorIdent}; use crate::widget::{self, Child, ChildIdent}; use proc_macro2::{Span, TokenStream as Toks}; -use proc_macro_error::emit_error; +use proc_macro_error2::{emit_error, emit_warning}; use quote::{quote, quote_spanned, ToTokens, TokenStreamExt}; use syn::parse::{Parse, ParseStream, Result}; use syn::spanned::Spanned; @@ -418,7 +418,7 @@ impl Layout { let _ = Pack::parse(dot_token, &input2, &mut temp_gen)?; continue; } else if let Ok(ident) = input2.parse::() { - proc_macro_error::emit_warning!( + emit_warning!( ident, "this method call is incompatible with feature `recursive-layout-widgets`"; note = "extract operand from layout expression or wrap with braces", ); diff --git a/crates/kas-macros/src/widget.rs b/crates/kas-macros/src/widget.rs index 8cbd2f47..dcccb852 100644 --- a/crates/kas-macros/src/widget.rs +++ b/crates/kas-macros/src/widget.rs @@ -8,7 +8,7 @@ use impl_tools_lib::fields::{Fields, FieldsNamed, FieldsUnnamed}; use impl_tools_lib::scope::{Scope, ScopeAttr, ScopeItem}; use impl_tools_lib::SimplePath; use proc_macro2::{Span, TokenStream as Toks}; -use proc_macro_error::{emit_error, emit_warning}; +use proc_macro_error2::{emit_error, emit_warning}; use quote::{quote, quote_spanned, ToTokens, TokenStreamExt}; use syn::parse::{Error, Parse, ParseStream, Result}; use syn::spanned::Spanned; diff --git a/crates/kas-macros/src/widget_index.rs b/crates/kas-macros/src/widget_index.rs index eebd76f9..7b76c8f5 100644 --- a/crates/kas-macros/src/widget_index.rs +++ b/crates/kas-macros/src/widget_index.rs @@ -4,7 +4,7 @@ // https://www.apache.org/licenses/LICENSE-2.0 use proc_macro2::Span; -use proc_macro_error::emit_error; +use proc_macro_error2::emit_error; use syn::parse::{Parse, ParseStream}; use syn::spanned::Spanned; use syn::visit_mut::{self, VisitMut};