diff --git a/crates/rust-lib/src/lib.rs b/crates/rust-lib/src/lib.rs index 93ae37a4d..b4a901afa 100644 --- a/crates/rust-lib/src/lib.rs +++ b/crates/rust-lib/src/lib.rs @@ -242,8 +242,11 @@ pub trait RustGenerator<'a> { // the API level, ownership isn't required. if info.has_list && lt.is_none() { if let TypeMode::AllBorrowed(lt) | TypeMode::LeafBorrowed(lt) = mode { - assert_eq!(lt, "'_"); self.push_str("&"); + if lt != "'_" { + self.push_str(lt); + self.push_str(" "); + } } } let name = self.type_path(id, lt.is_none()); diff --git a/tests/codegen/issue551.wit b/tests/codegen/issue551.wit new file mode 100644 index 000000000..28033c823 --- /dev/null +++ b/tests/codegen/issue551.wit @@ -0,0 +1,11 @@ +default world bindings { + import component: self.component +} + +interface component { + type value = list> + type entity = list> + + add-components: func(entity: u64, data: entity) + query-eval: func(q: u64) -> list>> +}