diff --git a/src/macros.rs b/src/macros.rs index 19bab5f498a54..baea69e6783c0 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -253,7 +253,7 @@ macro_rules! s_no_extra_traits { macro_rules! extern_ty { ($( $(#[$attr:meta])* - pub type $i:ident; + $vis:vis type $i:ident; )*) => ($( $(#[$attr])* /// This is an extern type ("opaque" or "incomplete" type in C). @@ -279,7 +279,7 @@ macro_rules! extern_ty { ::core::fmt::Debug, )] #[repr(C)] - pub struct $i { + $vis struct $i { _data: (), _marker: ::core::marker::PhantomData<(*mut u8, ::core::marker::PhantomPinned)>, } @@ -621,4 +621,9 @@ mod macro_checks { b: f32, } } + + extern_ty! { + type Foo; + pub type Bar; + } }