Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions macro/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,11 @@ fn expand_rust_function_shim_impl(
}

fn expand_type_alias(alias: &TypeAlias) -> TokenStream {
let doc = &alias.doc;
let ident = &alias.ident;
let ty = &alias.ty;
quote! {
#doc
pub type #ident = #ty;
}
}
Expand Down
1 change: 1 addition & 0 deletions syntax/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub struct ExternFn {
}

pub struct TypeAlias {
pub doc: Doc,
pub type_token: Token![type],
pub ident: Ident,
pub eq_token: Token![=],
Expand Down
3 changes: 2 additions & 1 deletion syntax/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,10 @@ fn parse_extern_verbatim(cx: &mut Errors, tokens: &TokenStream, lang: Lang) -> R
let eq_token: Token![=] = input.parse()?;
let ty: RustType = input.parse()?;
let semi_token: Token![;] = input.parse()?;
attrs::parse_doc(cx, &attrs);
let doc = attrs::parse_doc(cx, &attrs);

Ok(TypeAlias {
doc,
type_token,
ident,
eq_token,
Expand Down