| 2638 | } |
| 2639 | |
| 2640 | pub fn is_list_canonical(&self, ty: &Type) -> bool { |
| 2641 | if !self.resolve.all_bits_valid(ty) { |
| 2642 | return false; |
| 2643 | } |
| 2644 | match ty { |
| 2645 | // Note that tuples in Rust are not ABI-compatible with component |
| 2646 | // model tuples, so those are exempted here from canonical lists. |
| 2647 | Type::Id(id) => { |
| 2648 | let info = self.r#gen.types.get(*id); |
| 2649 | !info.has_resource && !info.has_tuple |
| 2650 | } |
| 2651 | _ => true, |
| 2652 | } |
| 2653 | } |
| 2654 | } |
| 2655 | |
| 2656 | impl<'a> wit_bindgen_core::InterfaceGenerator<'a> for InterfaceGenerator<'a> { |