Gate repr(Rust) correctly on non-ADT items
This commit is contained in:
parent
0f6e1ae678
commit
363addc79c
3 changed files with 73 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue