Fix a few more mistakes from slices

This commit is contained in:
Alex Crichton
2018-02-16 19:19:31 -08:00
parent 0970fa2998
commit 9e7a4e7e60
3 changed files with 4 additions and 4 deletions

View File

@ -148,7 +148,7 @@ fn bindgen_export(export: &ast::Export, into: &mut Tokens) {
let ptr = syn::Ident::from(format!("arg{}_ptr", i));
let len = syn::Ident::from(format!("arg{}_len", i));
let abi_ty = ty.abi_element();
args.push(my_quote! { #ptr: *const #abi_ty });
args.push(my_quote! { #ptr: *mut #abi_ty });
args.push(my_quote! { #len: usize });
if owned {
arg_conversions.push(my_quote! {
@ -159,7 +159,7 @@ fn bindgen_export(export: &ast::Export, into: &mut Tokens) {
} else {
arg_conversions.push(my_quote! {
let #ident = unsafe {
::std::slice::from_raw_parts(#ptr, #len)
::std::slice::from_raw_parts(#ptr as *const #abi_ty, #len)
};
});
}