diff --git a/src/items.rs b/src/items.rs index d5369e33ef8..6c8b6e06284 100644 --- a/src/items.rs +++ b/src/items.rs @@ -2780,6 +2780,10 @@ impl Rewrite for ast::ForeignItem { format!("{}{}{};", prefix, sep, ty_str) }) } + ast::ForeignItemKind::Ty => { + let vis = format_visibility(&self.vis); + Some(format!("{}type {};", vis, self.ident)) + } }); let missing_span = if self.attrs.is_empty() { diff --git a/tests/source/extern.rs b/tests/source/extern.rs index 5546b217226..55ef830544c 100644 --- a/tests/source/extern.rs +++ b/tests/source/extern.rs @@ -25,6 +25,11 @@ extern { fn DMR_GetDevice(pHDev: *mut HDEV, searchMode: DeviceSearchMode, pSearchString: *const c_char, devNr: c_uint, wildcard: c_char) -> TDMR_ERROR; fn quux() -> (); // Post comment + + type + Foo; + + type Bar; } extern "Rust" { static ext: u32; diff --git a/tests/target/extern.rs b/tests/target/extern.rs index c0601a4d0e1..19f8c332dd0 100644 --- a/tests/target/extern.rs +++ b/tests/target/extern.rs @@ -34,6 +34,10 @@ extern "C" { ) -> TDMR_ERROR; fn quux() -> (); // Post comment + + type Foo; + + type Bar; } extern "Rust" {