Skip to content

Commit ebf7275

Browse files
committed
Move unsized type comment to the right function
1 parent a813721 commit ebf7275

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

macro/src/expand.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn expand(ffi: Module, doc: Doc, attrs: OtherAttrs, apis: &[Api], types: &Types)
5353
for api in apis {
5454
if let Api::RustType(ety) = api {
5555
expanded.extend(expand_rust_type_import(ety));
56-
hidden.extend(expand_rust_type_assert_sized(ety));
56+
hidden.extend(expand_rust_type_assert_unpin(ety));
5757
}
5858
}
5959

@@ -833,15 +833,7 @@ fn expand_rust_type_impl(ety: &ExternType) -> TokenStream {
833833
impls
834834
}
835835

836-
fn expand_rust_type_assert_sized(ety: &ExternType) -> TokenStream {
837-
// Rustc will render as follows if not sized:
838-
//
839-
// type TheirType;
840-
// -----^^^^^^^^^-
841-
// | |
842-
// | doesn't have a size known at compile-time
843-
// required by this bound in `ffi::_::__AssertSized`
844-
836+
fn expand_rust_type_assert_unpin(ety: &ExternType) -> TokenStream {
845837
let ident = &ety.name.rust;
846838
let begin_span = Token![::](ety.type_token.span);
847839
let unpin = quote_spanned! {ety.semi_token.span=>
@@ -856,6 +848,14 @@ fn expand_rust_type_assert_sized(ety: &ExternType) -> TokenStream {
856848
}
857849

858850
fn expand_rust_type_layout(ety: &ExternType) -> TokenStream {
851+
// Rustc will render as follows if not sized:
852+
//
853+
// type TheirType;
854+
// -----^^^^^^^^^-
855+
// | |
856+
// | doesn't have a size known at compile-time
857+
// required by this bound in `__AssertSized`
858+
859859
let ident = &ety.name.rust;
860860
let begin_span = Token![::](ety.type_token.span);
861861
let sized = quote_spanned! {ety.semi_token.span=>

0 commit comments

Comments
 (0)