Skip to content

Commit

Permalink
Fixes for Rust 1.72 (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcharles authored Sep 6, 2023
1 parent d890e65 commit 6b70c93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"crates/core",
"crates/cli",
]
resolver = "2"

[workspace.package]
version = "1.1.2"
Expand Down
12 changes: 9 additions & 3 deletions crates/cli/src/wasm_generator/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ pub fn generate(js: &JS, exports: Vec<Export>) -> Result<Vec<u8>> {
let invoke_export = invoke.id();

if !exports.is_empty() {
let ExportItem::Function(realloc_fn) = realloc.item else { unreachable!() };
let ExportItem::Function(invoke_fn) = invoke.item else { unreachable!() };
let ExportItem::Memory(memory) = memory.item else { unreachable!() };
let ExportItem::Function(realloc_fn) = realloc.item else {
unreachable!()
};
let ExportItem::Function(invoke_fn) = invoke.item else {
unreachable!()
};
let ExportItem::Memory(memory) = memory.item else {
unreachable!()
};
export_exported_js_functions(&mut module, realloc_fn, invoke_fn, memory, exports);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/quickjs-wasm-rs/src/js_binding/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl JSContextRef {
JS_WRITE_OBJ_BYTECODE as i32,
);
Ok(Vec::from_raw_parts(
output_buffer as *mut u8,
output_buffer,
output_size.try_into()?,
output_size.try_into()?,
))
Expand Down

0 comments on commit 6b70c93

Please sign in to comment.