wit-bindgen-core
Advanced tools
| { | ||
| "git": { | ||
| "sha1": "d61d3708fe4a90ab811b94e1fd608f2f05fa2513" | ||
| "sha1": "b858f8e0bfacf371dee1bbf7097b3022339feb93" | ||
| }, | ||
| "path_in_vcs": "crates/core" | ||
| } |
+1
-1
@@ -318,3 +318,3 @@ # This file is automatically @generated by Cargo. | ||
| name = "wit-bindgen-core" | ||
| version = "0.53.1" | ||
| version = "0.54.0" | ||
| dependencies = [ | ||
@@ -321,0 +321,0 @@ "anyhow", |
+1
-1
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "wit-bindgen-core" | ||
| version = "0.53.1" | ||
| version = "0.54.0" | ||
| authors = ["Alex Crichton <alex@alexcrichton.com>"] | ||
@@ -19,0 +19,0 @@ build = false |
+4
-1
@@ -168,2 +168,3 @@ use std::fmt::Write; | ||
| fn type_list(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs); | ||
| fn type_fixed_length_list(&mut self, id: TypeId, name: &str, ty: &Type, size: u32, docs: &Docs); | ||
| fn type_builtin(&mut self, id: TypeId, name: &str, ty: &Type, docs: &Docs); | ||
@@ -203,3 +204,5 @@ fn type_future(&mut self, id: TypeId, name: &str, ty: &Option<Type>, docs: &Docs); | ||
| TypeDefKind::Handle(_) => panic!("handle types do not require definition"), | ||
| TypeDefKind::FixedLengthList(..) => todo!(), | ||
| TypeDefKind::FixedLengthList(t, size) => { | ||
| generator.type_fixed_length_list(id, name, t, *size, &ty.docs) | ||
| } | ||
| TypeDefKind::Map(..) => todo!(), | ||
@@ -206,0 +209,0 @@ TypeDefKind::Unknown => unreachable!(), |
+7
-5
@@ -98,4 +98,3 @@ use std::collections::HashMap; | ||
| /// Populates the return value of [`Types::get_representative_type`] with | ||
| /// the `resolve` passed in. | ||
| /// Identify all the structurally equal types reachable from the `world_id`. | ||
| /// | ||
@@ -113,5 +112,8 @@ /// The `may_alias_another_type` closure is used to determine whether the | ||
| resolve: &Resolve, | ||
| world_id: WorldId, | ||
| may_alias_another_type: &dyn Fn(TypeId) -> bool, | ||
| ) { | ||
| for (i, (ty, _)) in resolve.types.iter().enumerate() { | ||
| let mut live_types = wit_parser::LiveTypes::default(); | ||
| live_types.add_world(resolve, world_id); | ||
| for (i, ty) in live_types.iter().enumerate() { | ||
| if !may_alias_another_type(ty) { | ||
@@ -121,3 +123,3 @@ continue; | ||
| // TODO: we could define a hash function for TypeDefKind to prevent the inner loop. | ||
| for (earlier, _) in resolve.types.iter().take(i) { | ||
| for earlier in live_types.iter().take(i) { | ||
| if self.equal_types.find(ty) == self.equal_types.find(earlier) { | ||
@@ -127,3 +129,3 @@ continue; | ||
| // The correctness of is_structurally_equal relies on the fact | ||
| // that resolve.types.iter() is in topological order. | ||
| // that live_types.iter() is in topological order. | ||
| if self.is_structurally_equal(resolve, ty, earlier) { | ||
@@ -130,0 +132,0 @@ self.equal_types.union(ty, earlier); |