rust/tests/ui/lint/auxiliary/unaligned_references_external_crate.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
605 B
Rust
Raw Normal View History

#[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;
)+
}
};
};
}