Allow explicit #[repr(Rust)]

This commit is contained in:
Catherine Flores
2023-07-29 06:58:29 +00:00
parent 8771282d4e
commit f42d361a22
7 changed files with 24 additions and 8 deletions

View File

@@ -940,6 +940,7 @@ where
#[derive(PartialEq, Debug, Encodable, Decodable, Copy, Clone)]
pub enum ReprAttr {
ReprInt(IntType),
ReprRust,
ReprC,
ReprPacked(u32),
ReprSimd,
@@ -988,6 +989,7 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
let mut recognised = false;
if item.is_word() {
let hint = match item.name_or_empty() {
sym::Rust => Some(ReprRust),
sym::C => Some(ReprC),
sym::packed => Some(ReprPacked(1)),
sym::simd => Some(ReprSimd),