Skip to content

Commit 3bfded1

Browse files
committed
xtask: Add check for missing repr when using macro
1 parent 3350103 commit 3bfded1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

xtask/src/check_raw.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ fn check_macro(item: &ItemMacro, src: &Path) -> Result<(), Error> {
389389
let attrs = parse_attrs(&attrs.0, src)?;
390390

391391
let reprs = get_reprs(&attrs);
392+
if reprs.is_empty() {
393+
return Err(Error::new(ErrorKind::MissingRepr, src, mac));
394+
}
392395
let allowed_reprs: &[&[Repr]] = &[&[Repr::Transparent]];
393396
if !allowed_reprs.contains(&reprs.as_slice()) {
394397
return Err(Error::new(ErrorKind::ForbiddenRepr(reprs), src, mac));

0 commit comments

Comments
 (0)