rust/tests/ui/lint/auxiliary/unaligned_references_external_crate.rs
2023-01-11 09:32:08 +00:00

29 lines
605 B
Rust

#[macro_export]
macro_rules! mac {
(
$(#[$attrs:meta])*
pub struct $ident:ident {
$(
$(#[$pin:ident])?
$field_vis:vis $field:ident: $field_ty:ty
),+ $(,)?
}
) => {
$(#[$attrs])*
pub struct $ident {
$(
$field_vis $field: $field_ty
),+
}
const _: () = {
#[deny(unaligned_references)]
fn __f(this: &$ident) {
$(
let _ = &this.$field;
)+
}
};
};
}