From b3daad4b2fee155cf3d233f93a054c563f62c742 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 19 Apr 2022 12:47:01 -0700 Subject: [PATCH] Remove support for `usize` and `char8` Further iteration from #195 and dropping more features that are only needed for `*.witx`, the `usize` and `char8` types were only added for backcompat with witx itself. --- crates/gen-c/src/lib.rs | 8 +------- crates/gen-js/src/lib.rs | 10 ++++------ crates/gen-markdown/src/lib.rs | 2 -- crates/gen-rust-wasm/src/lib.rs | 11 ++--------- crates/gen-rust/src/lib.rs | 3 --- crates/gen-spidermonkey/src/lib.rs | 4 ---- crates/gen-wasmtime-py/src/lib.rs | 12 +++++------- crates/gen-wasmtime/src/lib.rs | 12 +++--------- crates/parser/src/abi.rs | 28 +++++----------------------- crates/parser/src/ast.rs | 4 ---- crates/parser/src/ast/resolve.rs | 2 -- crates/parser/src/lib.rs | 6 +----- crates/parser/src/sizealign.rs | 8 ++++---- crates/parser/tests/all.rs | 2 -- crates/test-helpers/src/lib.rs | 2 -- crates/wit-component/src/encoding.rs | 4 ---- crates/wit-component/src/printing.rs | 4 ++-- 17 files changed, 27 insertions(+), 95 deletions(-) diff --git a/crates/gen-c/src/lib.rs b/crates/gen-c/src/lib.rs index 8c3383dee..a1cad2b4d 100644 --- a/crates/gen-c/src/lib.rs +++ b/crates/gen-c/src/lib.rs @@ -223,10 +223,8 @@ impl C { Type::S32 => self.src.h("int32_t"), Type::U64 => self.src.h("uint64_t"), Type::S64 => self.src.h("int64_t"), - Type::CChar => self.src.h("char"), Type::F32 => self.src.h("float"), Type::F64 => self.src.h("double"), - Type::Usize => self.src.h("size_t"), Type::Handle(id) => { self.print_namespace(iface); self.src.h(&iface.resources[*id].name.to_snake_case()); @@ -280,10 +278,8 @@ impl C { Type::S32 => self.src.h("s32"), Type::U64 => self.src.h("u64"), Type::S64 => self.src.h("s64"), - Type::CChar => self.src.h("char"), Type::F32 => self.src.h("f32"), Type::F64 => self.src.h("f64"), - Type::Usize => self.src.h("usize"), Type::Handle(id) => self.src.h(&iface.resources[*id].name.to_snake_case()), Type::Id(id) => { let ty = &iface.types[*id]; @@ -1297,10 +1293,8 @@ impl Bindgen for FunctionBindgen<'_> { Instruction::U32FromI32 => results.push(format!("(uint32_t) ({})", operands[0])), Instruction::S32FromI32 | Instruction::S64FromI64 => results.push(operands[0].clone()), Instruction::U64FromI64 => results.push(format!("(uint64_t) ({})", operands[0])), - Instruction::UsizeFromI32 => results.push(format!("(size_t) ({})", operands[0])), - Instruction::I32FromUsize - | Instruction::I32FromU8 + Instruction::I32FromU8 | Instruction::I32FromS8 | Instruction::I32FromU16 | Instruction::I32FromS16 diff --git a/crates/gen-js/src/lib.rs b/crates/gen-js/src/lib.rs index 57492f877..1cd881045 100644 --- a/crates/gen-js/src/lib.rs +++ b/crates/gen-js/src/lib.rs @@ -123,11 +123,11 @@ impl Js { fn array_ty(&self, iface: &Interface, ty: &Type) -> Option<&'static str> { match ty { - Type::U8 | Type::CChar => Some("Uint8Array"), + Type::U8 => Some("Uint8Array"), Type::S8 => Some("Int8Array"), Type::U16 => Some("Uint16Array"), Type::S16 => Some("Int16Array"), - Type::U32 | Type::Usize => Some("Uint32Array"), + Type::U32 => Some("Uint32Array"), Type::S32 => Some("Int32Array"), Type::U64 => Some("BigUint64Array"), Type::S64 => Some("BigInt64Array"), @@ -145,12 +145,10 @@ impl Js { fn print_ty(&mut self, iface: &Interface, ty: &Type) { match ty { Type::U8 - | Type::CChar | Type::S8 | Type::U16 | Type::S16 | Type::U32 - | Type::Usize | Type::S32 | Type::F32 | Type::F64 => self.src.ts("number"), @@ -1228,7 +1226,7 @@ impl Bindgen for FunctionBindgen<'_> { Instruction::S16FromI32 => self.clamp_guest(results, operands, i16::MIN, i16::MAX), // Use `>>>0` to ensure the bits of the number are treated as // unsigned. - Instruction::U32FromI32 | Instruction::UsizeFromI32 => { + Instruction::U32FromI32 => { results.push(format!("{} >>> 0", operands[0])); } // All bigints coming from wasm are treated as signed, so convert @@ -1246,7 +1244,7 @@ impl Bindgen for FunctionBindgen<'_> { Instruction::I32FromS8 => self.clamp_host(results, operands, i8::MIN, i8::MAX), Instruction::I32FromU16 => self.clamp_host(results, operands, u16::MIN, u16::MAX), Instruction::I32FromS16 => self.clamp_host(results, operands, i16::MIN, i16::MAX), - Instruction::I32FromU32 | Instruction::I32FromUsize => { + Instruction::I32FromU32 => { self.clamp_host(results, operands, u32::MIN, u32::MAX); } Instruction::I32FromS32 => self.clamp_host(results, operands, i32::MIN, i32::MAX), diff --git a/crates/gen-markdown/src/lib.rs b/crates/gen-markdown/src/lib.rs index df91200f4..15d4ca5d7 100644 --- a/crates/gen-markdown/src/lib.rs +++ b/crates/gen-markdown/src/lib.rs @@ -46,8 +46,6 @@ impl Markdown { Type::F32 => self.src.push_str("`f32`"), Type::F64 => self.src.push_str("`f64`"), Type::Char => self.src.push_str("`char`"), - Type::CChar => self.src.push_str("`c_char`"), - Type::Usize => self.src.push_str("`usize`"), Type::Handle(id) => { self.src.push_str("handle<"); self.src.push_str(&iface.resources[*id].name); diff --git a/crates/gen-rust-wasm/src/lib.rs b/crates/gen-rust-wasm/src/lib.rs index 68f0ad18c..faab60a17 100644 --- a/crates/gen-rust-wasm/src/lib.rs +++ b/crates/gen-rust-wasm/src/lib.rs @@ -123,10 +123,6 @@ impl RustGenerator for RustWasm { &mut self.types } - fn print_usize(&mut self) { - self.src.push_str("usize"); - } - fn print_pointer(&mut self, iface: &Interface, const_: bool, ty: &Type) { self.push_str("*"); if const_ { @@ -858,11 +854,9 @@ impl Bindgen for FunctionBindgen<'_> { let s = operands.pop().unwrap(); results.push(format!("wit_bindgen_rust::rt::as_i64({})", s)); } - Instruction::I32FromUsize - | Instruction::I32FromChar + Instruction::I32FromChar | Instruction::I32FromU8 | Instruction::I32FromS8 - | Instruction::I32FromChar8 | Instruction::I32FromU16 | Instruction::I32FromS16 | Instruction::I32FromU32 @@ -886,12 +880,11 @@ impl Bindgen for FunctionBindgen<'_> { results.push(operands.pop().unwrap()); } Instruction::S8FromI32 => top_as("i8"), - Instruction::Char8FromI32 | Instruction::U8FromI32 => top_as("u8"), + Instruction::U8FromI32 => top_as("u8"), Instruction::S16FromI32 => top_as("i16"), Instruction::U16FromI32 => top_as("u16"), Instruction::U32FromI32 => top_as("u32"), Instruction::U64FromI64 => top_as("u64"), - Instruction::UsizeFromI32 => top_as("usize"), Instruction::CharFromI32 => { if unchecked { results.push(format!( diff --git a/crates/gen-rust/src/lib.rs b/crates/gen-rust/src/lib.rs index 73744801c..95d31055b 100644 --- a/crates/gen-rust/src/lib.rs +++ b/crates/gen-rust/src/lib.rs @@ -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_usize(&mut self); fn print_pointer(&mut self, iface: &Interface, const_: bool, ty: &Type); fn print_borrowed_slice( &mut self, @@ -200,10 +199,8 @@ pub trait RustGenerator { } Type::U8 => self.push_str("u8"), - Type::CChar => self.push_str("u8"), Type::U16 => self.push_str("u16"), Type::U32 => self.push_str("u32"), - Type::Usize => self.print_usize(), Type::U64 => self.push_str("u64"), Type::S8 => self.push_str("i8"), Type::S16 => self.push_str("i16"), diff --git a/crates/gen-spidermonkey/src/lib.rs b/crates/gen-spidermonkey/src/lib.rs index 6fcf56363..53d91fbf5 100644 --- a/crates/gen-spidermonkey/src/lib.rs +++ b/crates/gen-spidermonkey/src/lib.rs @@ -1475,8 +1475,6 @@ impl abi::Bindgen for Bindgen<'_, '_> { abi::Instruction::I32FromS16 => todo!(), abi::Instruction::I32FromU8 => todo!(), abi::Instruction::I32FromS8 => todo!(), - abi::Instruction::I32FromUsize => todo!(), - abi::Instruction::I32FromChar8 => todo!(), abi::Instruction::F32FromIf32 => todo!(), abi::Instruction::F64FromIf64 => todo!(), abi::Instruction::S8FromI32 => todo!(), @@ -1505,8 +1503,6 @@ impl abi::Bindgen for Bindgen<'_, '_> { abi::Instruction::CharFromI32 => todo!(), abi::Instruction::If32FromF32 => todo!(), abi::Instruction::If64FromF64 => todo!(), - abi::Instruction::Char8FromI32 => todo!(), - abi::Instruction::UsizeFromI32 => todo!(), abi::Instruction::I32FromBorrowedHandle { ty: _ } => todo!(), abi::Instruction::I32FromOwnedHandle { ty: _ } => todo!(), abi::Instruction::HandleOwnedFromI32 { ty: _ } => todo!(), diff --git a/crates/gen-wasmtime-py/src/lib.rs b/crates/gen-wasmtime-py/src/lib.rs index 8ea632c2d..f6a4f54e1 100644 --- a/crates/gen-wasmtime-py/src/lib.rs +++ b/crates/gen-wasmtime-py/src/lib.rs @@ -377,9 +377,7 @@ impl WasmtimePy { | Type::U32 | Type::S32 | Type::U64 - | Type::S64 - | Type::Usize - | Type::CChar => self.src.push_str("int"), + | Type::S64 => self.src.push_str("int"), Type::F32 | Type::F64 => self.src.push_str("float"), Type::Char => self.src.push_str("str"), Type::Handle(id) => { @@ -493,11 +491,11 @@ impl WasmtimePy { fn array_ty(&self, iface: &Interface, ty: &Type) -> Option<&'static str> { match ty { - Type::U8 | Type::CChar => Some("c_uint8"), + Type::U8 => Some("c_uint8"), Type::S8 => Some("c_int8"), Type::U16 => Some("c_uint16"), Type::S16 => Some("c_int16"), - Type::U32 | Type::Usize => Some("c_uint32"), + Type::U32 => Some("c_uint32"), Type::S32 => Some("c_int32"), Type::U64 => Some("c_uint64"), Type::S64 => Some("c_int64"), @@ -1346,7 +1344,7 @@ impl Bindgen for FunctionBindgen<'_> { Instruction::U16FromI32 => self.clamp(results, operands, u16::MIN, u16::MAX), Instruction::S16FromI32 => self.clamp(results, operands, i16::MIN, i16::MAX), // Ensure the bits of the number are treated as unsigned. - Instruction::U32FromI32 | Instruction::UsizeFromI32 => { + Instruction::U32FromI32 => { results.push(format!("{} & 0xffffffff", operands[0])); } // All bigints coming from wasm are treated as signed, so convert @@ -1367,7 +1365,7 @@ impl Bindgen for FunctionBindgen<'_> { Instruction::I32FromU16 => self.clamp(results, operands, u16::MIN, u16::MAX), Instruction::I32FromS16 => self.clamp(results, operands, i16::MIN, i16::MAX), // TODO: need to do something to get this to be represented as signed? - Instruction::I32FromU32 | Instruction::I32FromUsize => { + Instruction::I32FromU32 => { self.clamp(results, operands, u32::MIN, u32::MAX); } Instruction::I32FromS32 => self.clamp(results, operands, i32::MIN, i32::MAX), diff --git a/crates/gen-wasmtime/src/lib.rs b/crates/gen-wasmtime/src/lib.rs index 1698b45e2..0f30b3cf5 100644 --- a/crates/gen-wasmtime/src/lib.rs +++ b/crates/gen-wasmtime/src/lib.rs @@ -266,10 +266,6 @@ impl RustGenerator for Wasmtime { &mut self.types } - fn print_usize(&mut self) { - self.src.push_str("u32"); - } - fn print_pointer(&mut self, _iface: &Interface, _const_: bool, _ty: &Type) { self.push_str("u32"); } @@ -1434,11 +1430,9 @@ impl Bindgen for FunctionBindgen<'_> { let s = operands.pop().unwrap(); results.push(format!("wit_bindgen_wasmtime::rt::as_i64({})", s)); } - Instruction::I32FromUsize - | Instruction::I32FromChar + Instruction::I32FromChar | Instruction::I32FromU8 | Instruction::I32FromS8 - | Instruction::I32FromChar8 | Instruction::I32FromU16 | Instruction::I32FromS16 | Instruction::I32FromU32 @@ -1461,13 +1455,13 @@ impl Bindgen for FunctionBindgen<'_> { // necessary since we could chop bits off this should be more // forward-compatible with any future changes. Instruction::S8FromI32 => try_from("i8", operands, results), - Instruction::Char8FromI32 | Instruction::U8FromI32 => try_from("u8", operands, results), + Instruction::U8FromI32 => try_from("u8", operands, results), Instruction::S16FromI32 => try_from("i16", operands, results), Instruction::U16FromI32 => try_from("u16", operands, results), // Casts of the same bit width simply use `as` since we're just // reinterpreting the bits already there. - Instruction::U32FromI32 | Instruction::UsizeFromI32 => top_as("u32"), + Instruction::U32FromI32 => top_as("u32"), Instruction::U64FromI64 => top_as("u64"), Instruction::CharFromI32 => { diff --git a/crates/parser/src/abi.rs b/crates/parser/src/abi.rs index 1a7a9ee04..c9a1b4fa5 100644 --- a/crates/parser/src/abi.rs +++ b/crates/parser/src/abi.rs @@ -203,10 +203,6 @@ def_instruction! { I32FromU8 : [1] => [1], /// Converts an interface type `s8` value to a wasm `i32`. I32FromS8 : [1] => [1], - /// Converts a language-specific `usize` value to a wasm `i32`. - I32FromUsize : [1] => [1], - /// Converts a language-specific C `char` value to a wasm `i32`. - I32FromChar8 : [1] => [1], /// Conversion an interface type `f32` value to a wasm `f32`. /// /// This may be a noop for some implementations, but it's here in case the @@ -252,12 +248,6 @@ def_instruction! { If32FromF32 : [1] => [1], /// Converts a native wasm `f64` to an interface type `f64`. If64FromF64 : [1] => [1], - /// Converts a native wasm `i32` to a language-specific C `char`. - /// - /// This will truncate the upper bits of the `i32`. - Char8FromI32 : [1] => [1], - /// Converts a native wasm `i32` to a language-specific `usize`. - UsizeFromI32 : [1] => [1], // Handles @@ -854,9 +844,7 @@ impl Interface { | Type::S32 | Type::U32 | Type::Char - | Type::Handle(_) - | Type::CChar - | Type::Usize => result.push(WasmType::I32), + | Type::Handle(_) => result.push(WasmType::I32), Type::U64 | Type::S64 => result.push(WasmType::I64), Type::F32 => result.push(WasmType::F32), @@ -1303,12 +1291,10 @@ impl<'a, B: Bindgen> Generator<'a, B> { match *ty { Type::S8 => self.emit(&I32FromS8), Type::U8 => self.emit(&I32FromU8), - Type::CChar => self.emit(&I32FromChar8), Type::S16 => self.emit(&I32FromS16), Type::U16 => self.emit(&I32FromU16), Type::S32 => self.emit(&I32FromS32), Type::U32 => self.emit(&I32FromU32), - Type::Usize => self.emit(&I32FromUsize), Type::S64 => self.emit(&I64FromS64), Type::U64 => self.emit(&I64FromU64), Type::Char => self.emit(&I32FromChar), @@ -1478,12 +1464,10 @@ impl<'a, B: Bindgen> Generator<'a, B> { match *ty { Type::S8 => self.emit(&S8FromI32), - Type::CChar => self.emit(&Char8FromI32), Type::U8 => self.emit(&U8FromI32), Type::S16 => self.emit(&S16FromI32), Type::U16 => self.emit(&U16FromI32), Type::S32 => self.emit(&S32FromI32), - Type::Usize => self.emit(&UsizeFromI32), Type::U32 => self.emit(&U32FromI32), Type::S64 => self.emit(&S64FromI64), Type::U64 => self.emit(&U64FromI64), @@ -1617,11 +1601,9 @@ impl<'a, B: Bindgen> Generator<'a, B> { match *ty { // Builtin types need different flavors of storage instructions // depending on the size of the value written. - Type::U8 | Type::S8 | Type::CChar => { - self.lower_and_emit(ty, addr, &I32Store8 { offset }) - } + Type::U8 | Type::S8 => self.lower_and_emit(ty, addr, &I32Store8 { offset }), Type::U16 | Type::S16 => self.lower_and_emit(ty, addr, &I32Store16 { offset }), - Type::U32 | Type::S32 | Type::Usize | Type::Handle(_) | Type::Char => { + Type::U32 | Type::S32 | Type::Handle(_) | Type::Char => { self.lower_and_emit(ty, addr, &I32Store { offset }) } Type::U64 | Type::S64 => self.lower_and_emit(ty, addr, &I64Store { offset }), @@ -1729,11 +1711,11 @@ impl<'a, B: Bindgen> Generator<'a, B> { use Instruction::*; match *ty { - Type::U8 | Type::CChar => self.emit_and_lift(ty, addr, &I32Load8U { offset }), + Type::U8 => self.emit_and_lift(ty, addr, &I32Load8U { offset }), Type::S8 => self.emit_and_lift(ty, addr, &I32Load8S { offset }), Type::U16 => self.emit_and_lift(ty, addr, &I32Load16U { offset }), Type::S16 => self.emit_and_lift(ty, addr, &I32Load16S { offset }), - Type::U32 | Type::S32 | Type::Char | Type::Usize | Type::Handle(_) => { + Type::U32 | Type::S32 | Type::Char | Type::Handle(_) => { self.emit_and_lift(ty, addr, &I32Load { offset }) } Type::U64 | Type::S64 => self.emit_and_lift(ty, addr, &I64Load { offset }), diff --git a/crates/parser/src/ast.rs b/crates/parser/src/ast.rs index 972538a4b..22ed45f46 100644 --- a/crates/parser/src/ast.rs +++ b/crates/parser/src/ast.rs @@ -84,10 +84,6 @@ enum Type<'a> { F32, F64, Char, - #[allow(dead_code)] - Usize, - #[allow(dead_code)] - CChar, Handle(Id<'a>), Name(Id<'a>), List(Box>), diff --git a/crates/parser/src/ast/resolve.rs b/crates/parser/src/ast/resolve.rs index 9f8886372..5d9d51088 100644 --- a/crates/parser/src/ast/resolve.rs +++ b/crates/parser/src/ast/resolve.rs @@ -319,8 +319,6 @@ impl Resolver { super::Type::F32 => TypeDefKind::Type(Type::F32), super::Type::F64 => TypeDefKind::Type(Type::F64), super::Type::Char => TypeDefKind::Type(Type::Char), - super::Type::CChar => TypeDefKind::Type(Type::CChar), - super::Type::Usize => TypeDefKind::Type(Type::Usize), super::Type::Handle(resource) => { let id = match self.resource_lookup.get(&*resource.name) { Some(id) => *id, diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs index 1db996117..0ca3c7ea2 100644 --- a/crates/parser/src/lib.rs +++ b/crates/parser/src/lib.rs @@ -64,8 +64,6 @@ pub enum Type { F32, F64, Char, - CChar, - Usize, Handle(ResourceId), Id(TypeId), } @@ -433,9 +431,7 @@ impl Interface { | Type::U64 | Type::S64 | Type::F32 - | Type::F64 - | Type::CChar - | Type::Usize => true, + | Type::F64 => true, Type::Char | Type::Handle(_) => false, diff --git a/crates/parser/src/sizealign.rs b/crates/parser/src/sizealign.rs index b840754fa..e20e3f8fe 100644 --- a/crates/parser/src/sizealign.rs +++ b/crates/parser/src/sizealign.rs @@ -58,9 +58,9 @@ impl SizeAlign { pub fn size(&self, ty: &Type) -> usize { match ty { - Type::U8 | Type::S8 | Type::CChar => 1, + Type::U8 | Type::S8 => 1, Type::U16 | Type::S16 => 2, - Type::U32 | Type::S32 | Type::F32 | Type::Char | Type::Handle(_) | Type::Usize => 4, + Type::U32 | Type::S32 | Type::F32 | Type::Char | Type::Handle(_) => 4, Type::U64 | Type::S64 | Type::F64 => 8, Type::Id(id) => self.map[id.index()].0, } @@ -68,9 +68,9 @@ impl SizeAlign { pub fn align(&self, ty: &Type) -> usize { match ty { - Type::U8 | Type::S8 | Type::CChar => 1, + Type::U8 | Type::S8 => 1, Type::U16 | Type::S16 => 2, - Type::U32 | Type::S32 | Type::F32 | Type::Char | Type::Handle(_) | Type::Usize => 4, + Type::U32 | Type::S32 | Type::F32 | Type::Char | Type::Handle(_) => 4, Type::U64 | Type::S64 | Type::F64 => 8, Type::Id(id) => self.map[id.index()].1, } diff --git a/crates/parser/tests/all.rs b/crates/parser/tests/all.rs index 4a64f1ad0..2fbe5bf24 100644 --- a/crates/parser/tests/all.rs +++ b/crates/parser/tests/all.rs @@ -283,10 +283,8 @@ fn to_json(i: &Interface) -> String { use wit_parser::Type; match ty { Type::U8 => format!("u8"), - Type::CChar => format!("c_char"), Type::U16 => format!("u16"), Type::U32 => format!("u32"), - Type::Usize => format!("usize"), Type::U64 => format!("u64"), Type::S8 => format!("s8"), Type::S16 => format!("s16"), diff --git a/crates/test-helpers/src/lib.rs b/crates/test-helpers/src/lib.rs index ec5d37afe..b73966a81 100644 --- a/crates/test-helpers/src/lib.rs +++ b/crates/test-helpers/src/lib.rs @@ -152,8 +152,6 @@ pub fn codegen_rust_wasm_export(input: TokenStream) -> TokenStream { Type::S32 => quote::quote! { i32 }, Type::U64 => quote::quote! { u64 }, Type::S64 => quote::quote! { i64 }, - Type::CChar => quote::quote! { u8 }, - Type::Usize => quote::quote! { usize }, Type::F32 => quote::quote! { f32 }, Type::F64 => quote::quote! { f64 }, Type::Char => quote::quote! { char }, diff --git a/crates/wit-component/src/encoding.rs b/crates/wit-component/src/encoding.rs index f16d7ec2f..7923e8ca2 100644 --- a/crates/wit-component/src/encoding.rs +++ b/crates/wit-component/src/encoding.rs @@ -475,10 +475,6 @@ impl<'a> TypeEncoder<'a> { Type::Handle(_) => { bail!("the use of handle types in interfaces is not currently supported") } - Type::CChar => { - bail!("the use of C characters in interfaces is not currently supported") - } - Type::Usize => bail!("the use of usize in interfaces is not currently supported"), }) } diff --git a/crates/wit-component/src/printing.rs b/crates/wit-component/src/printing.rs index 4c66e37b4..1a84ab886 100644 --- a/crates/wit-component/src/printing.rs +++ b/crates/wit-component/src/printing.rs @@ -85,7 +85,7 @@ impl InterfacePrinter { } } - Type::CChar | Type::Usize | Type::Handle(_) => bail!("interface has unsupported type"), + Type::Handle(_) => bail!("interface has unsupported type"), } Ok(()) @@ -180,7 +180,7 @@ impl InterfacePrinter { } } - Type::CChar | Type::Usize | Type::Handle(_) => bail!("interface has unsupported type"), + Type::Handle(_) => bail!("interface has unsupported type"), } Ok(()) }