Skip to content

Commit 4ee705f

Browse files
authored
Remove outdated is_char check in ABI lowering (#938)
I think this predates the `string` type and was used at the time to fold `list<char>` into an ABI string or something like that. In any case `string` is a type nowadays and this brings the check for lifting in-line with the one for lowering. Closes #936
1 parent 8d16aad commit 4ee705f

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

crates/wit-parser/src/abi.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,9 +1457,7 @@ impl<'a, B: Bindgen> Generator<'a, B> {
14571457
Type::Id(id) => match &self.resolve.types[id].kind {
14581458
TypeDefKind::Type(t) => self.lift(t),
14591459
TypeDefKind::List(element) => {
1460-
if self.is_char(element)
1461-
|| self.bindgen.is_list_canonical(self.resolve, element)
1462-
{
1460+
if self.bindgen.is_list_canonical(self.resolve, element) {
14631461
self.emit(&ListCanonLift { element, ty: id });
14641462
} else {
14651463
self.push_block();
@@ -1983,17 +1981,6 @@ impl<'a, B: Bindgen> Generator<'a, B> {
19831981
});
19841982
}
19851983

1986-
fn is_char(&self, ty: &Type) -> bool {
1987-
match ty {
1988-
Type::Char => true,
1989-
Type::Id(id) => match &self.resolve.types[*id].kind {
1990-
TypeDefKind::Type(t) => self.is_char(t),
1991-
_ => false,
1992-
},
1993-
_ => false,
1994-
}
1995-
}
1996-
19971984
fn deallocate(&mut self, ty: &Type, addr: B::Operand, offset: i32) {
19981985
use Instruction::*;
19991986

0 commit comments

Comments
 (0)