Skip to content

Commit

Permalink
Remove RustGenerator::print_pointer
Browse files Browse the repository at this point in the history
Not actually needed for anything after bytecodealliance#195
  • Loading branch information
alexcrichton committed Apr 20, 2022
1 parent 6e260af commit f967e35
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
26 changes: 0 additions & 26 deletions crates/gen-rust-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,32 +123,6 @@ impl RustGenerator for RustWasm {
&mut self.types
}

fn print_pointer(&mut self, iface: &Interface, const_: bool, ty: &Type) {
self.push_str("*");
if const_ {
self.push_str("const ");
} else {
self.push_str("mut ");
}
let manually_drop = match ty {
Type::Id(id) => match &iface.types[*id].kind {
TypeDefKind::Record(_) => true,
TypeDefKind::List(_) | TypeDefKind::Variant(_) | TypeDefKind::Type(_) => {
panic!("unsupported pointer type")
}
},
Type::Handle(_) => true,
_ => false,
};
if manually_drop {
self.push_str("core::mem::ManuallyDrop<");
}
self.print_ty(iface, ty, TypeMode::Owned);
if manually_drop {
self.push_str(">");
}
}

fn print_borrowed_slice(
&mut self,
iface: &Interface,
Expand Down
1 change: 0 additions & 1 deletion crates/gen-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub trait RustGenerator {
fn push_str(&mut self, s: &str);
fn info(&self, ty: TypeId) -> TypeInfo;
fn types_mut(&mut self) -> &mut Types;
fn print_pointer(&mut self, iface: &Interface, const_: bool, ty: &Type);
fn print_borrowed_slice(
&mut self,
iface: &Interface,
Expand Down
4 changes: 0 additions & 4 deletions crates/gen-wasmtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,6 @@ impl RustGenerator for Wasmtime {
&mut self.types
}

fn print_pointer(&mut self, _iface: &Interface, _const_: bool, _ty: &Type) {
self.push_str("u32");
}

fn print_borrowed_slice(
&mut self,
iface: &Interface,
Expand Down

0 comments on commit f967e35

Please sign in to comment.