1
Fork 0

Gate repr(Rust) correctly on non-ADT items

This commit is contained in:
Michael Goulet 2024-08-22 14:22:19 -04:00
parent 0f6e1ae678
commit 363addc79c
3 changed files with 73 additions and 1 deletions

View file

@ -1791,6 +1791,15 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
match hint.name_or_empty() {
sym::Rust => {
is_explicit_rust = true;
match target {
Target::Struct | Target::Union | Target::Enum => continue,
_ => {
self.dcx().emit_err(errors::AttrApplication::StructEnumUnion {
hint_span: hint.span(),
span,
});
}
}
}
sym::C => {
is_c = true;