1
Fork 0

warn about broken simd not only on structs but also enums and unions when we didn't opt in to it

This commit is contained in:
Matthias Krüger 2025-01-07 21:36:37 +01:00
parent ad211ced81
commit b9d6e9e73f
5 changed files with 67 additions and 9 deletions

View file

@ -242,7 +242,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
}
}
ast::ItemKind::Struct(..) => {
ast::ItemKind::Struct(..) | ast::ItemKind::Enum(..) | ast::ItemKind::Union(..) => {
for attr in attr::filter_by_name(&i.attrs, sym::repr) {
for item in attr.meta_item_list().unwrap_or_else(ThinVec::new) {
if item.has_name(sym::simd) {