You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Representation options, specified via attributes e.g. #[repr(packed)]
structReprOptions
{
// bool is_c;
// bool is_transparent;
//...
// For align and pack: 0 = unspecified. Nonzero = byte alignment.
// It is an error for both to be nonzero, this should be caught when
// parsing the #[repr] attribute.
unsignedchar align = 0;
unsignedchar pack = 0;
};
I think it might be worth having some kind of error node state here. For example, during the type-checking of this structure, you could represent an error state by a flag or something so that when you are compiling the type we know if it's ok or not so we can error or ignore the options. This will only really matter down the line when we get rid of the saw_errors guards between each compiler pass.
Originally posted by @philberty in #1188 (comment)
For
ReprFlags
:Adding error node:
struct ReprOptions
, like:bool is_error
Raise Error while parsing the options:
gccrs/gcc/rust/typecheck/rust-hir-type-check-base.cc
Lines 312 to 347 in 0fe8a6b
Implementation of this in rustc:
Valid rustc reprs are here:
In rustc:
ReprOptions
is defined as:https://github.com/rust-lang/rust/blob/fcf3006e0133365ecd26894689c086387edcbecb/compiler/rustc_abi/src/lib.rs#L71-L87
Reprflags
are implemented as :https://github.com/rust-lang/rust/blob/fcf3006e0133365ecd26894689c086387edcbecb/compiler/rustc_abi/src/lib.rs#L36-L50
The text was updated successfully, but these errors were encountered: