fix: forward missing lint attributes passed to #[component] macro (#3989)

This commit is contained in:
Álvaro Mondéjar Rubio
2025-05-19 02:38:16 +02:00
committed by Greg Johnston
parent 89cbf86595
commit c8df5b75ef

View File

@@ -667,7 +667,13 @@ impl Parse for DummyModel {
let mut attrs = input.call(Attribute::parse_outer)?;
// Drop unknown attributes like #[deprecated]
drain_filter(&mut attrs, |attr| {
!(attr.path().is_ident("doc") || attr.path().is_ident("allow"))
let path = attr.path();
!(path.is_ident("doc")
|| path.is_ident("allow")
|| path.is_ident("expect")
|| path.is_ident("warn")
|| path.is_ident("deny")
|| path.is_ident("forbid"))
});
let vis: Visibility = input.parse()?;
@@ -956,13 +962,20 @@ impl UnknownAttrs {
let attrs = attrs
.iter()
.filter_map(|attr| {
if attr.path().is_ident("doc") {
let path = attr.path();
if path.is_ident("doc") {
if let Meta::NameValue(_) = &attr.meta {
return None;
}
}
if attr.path().is_ident("allow") {
if path.is_ident("allow")
|| path.is_ident("expect")
|| path.is_ident("warn")
|| path.is_ident("deny")
|| path.is_ident("forbid")
{
return None;
}