@@ -1045,8 +1045,8 @@ pub enum ComponentDefinedType {
10451045 Future ( Option < ComponentValType > ) ,
10461046 /// A stream type with the specified payload type.
10471047 Stream ( ComponentValType ) ,
1048- /// The error type.
1049- Error ,
1048+ /// The error-context type.
1049+ ErrorContext ,
10501050}
10511051
10521052impl TypeData for ComponentDefinedType {
@@ -1060,7 +1060,7 @@ impl TypeData for ComponentDefinedType {
10601060 | Self :: Own ( _)
10611061 | Self :: Future ( _)
10621062 | Self :: Stream ( _)
1063- | Self :: Error => TypeInfo :: new ( ) ,
1063+ | Self :: ErrorContext => TypeInfo :: new ( ) ,
10641064 Self :: Borrow ( _) => TypeInfo :: borrow ( ) ,
10651065 Self :: Record ( r) => r. info ,
10661066 Self :: Variant ( v) => v. info ,
@@ -1094,7 +1094,7 @@ impl ComponentDefinedType {
10941094 | Self :: Borrow ( _)
10951095 | Self :: Future ( _)
10961096 | Self :: Stream ( _)
1097- | Self :: Error => false ,
1097+ | Self :: ErrorContext => false ,
10981098 Self :: Option ( ty) => ty. contains_ptr ( types) ,
10991099 Self :: Result { ok, err } => {
11001100 ok. map ( |ty| ty. contains_ptr ( types) ) . unwrap_or ( false )
@@ -1128,7 +1128,7 @@ impl ComponentDefinedType {
11281128 | Self :: Borrow ( _)
11291129 | Self :: Future ( _)
11301130 | Self :: Stream ( _)
1131- | Self :: Error => lowered_types. push ( ValType :: I32 ) ,
1131+ | Self :: ErrorContext => lowered_types. push ( ValType :: I32 ) ,
11321132 Self :: Option ( ty) => {
11331133 Self :: push_variant_wasm_types ( [ ty] . into_iter ( ) , types, lowered_types)
11341134 }
@@ -1198,7 +1198,7 @@ impl ComponentDefinedType {
11981198 ComponentDefinedType :: Borrow ( _) => "borrow" ,
11991199 ComponentDefinedType :: Future ( _) => "future" ,
12001200 ComponentDefinedType :: Stream ( _) => "stream" ,
1201- ComponentDefinedType :: Error => "error" ,
1201+ ComponentDefinedType :: ErrorContext => "error-context " ,
12021202 }
12031203 }
12041204}
@@ -1914,7 +1914,7 @@ impl TypeAlloc {
19141914 ComponentDefinedType :: Primitive ( _)
19151915 | ComponentDefinedType :: Flags ( _)
19161916 | ComponentDefinedType :: Enum ( _)
1917- | ComponentDefinedType :: Error => { }
1917+ | ComponentDefinedType :: ErrorContext => { }
19181918 ComponentDefinedType :: Record ( r) => {
19191919 for ty in r. fields . values ( ) {
19201920 self . free_variables_valtype ( ty, set) ;
@@ -2053,7 +2053,7 @@ impl TypeAlloc {
20532053 let ty = & self [ id] ;
20542054 match ty {
20552055 // Primitives are always considered named
2056- ComponentDefinedType :: Primitive ( _) | ComponentDefinedType :: Error => true ,
2056+ ComponentDefinedType :: Primitive ( _) | ComponentDefinedType :: ErrorContext => true ,
20572057
20582058 // These structures are never allowed to be anonymous, so they
20592059 // themselves must be named.
@@ -2241,7 +2241,7 @@ where
22412241 ComponentDefinedType :: Primitive ( _)
22422242 | ComponentDefinedType :: Flags ( _)
22432243 | ComponentDefinedType :: Enum ( _)
2244- | ComponentDefinedType :: Error => { }
2244+ | ComponentDefinedType :: ErrorContext => { }
22452245 ComponentDefinedType :: Record ( r) => {
22462246 for ty in r. fields . values_mut ( ) {
22472247 any_changed |= self . remap_valtype ( ty, map) ;
@@ -3220,8 +3220,8 @@ impl<'a> SubtypeCx<'a> {
32203220 . component_val_type ( a, b, offset)
32213221 . with_context ( || "type mismatch in stream" ) ,
32223222 ( Stream ( _) , b) => bail ! ( offset, "expected {}, found stream" , b. desc( ) ) ,
3223- ( Error , Error ) => Ok ( ( ) ) ,
3224- ( Error , b) => bail ! ( offset, "expected {}, found error" , b. desc( ) ) ,
3223+ ( ErrorContext , ErrorContext ) => Ok ( ( ) ) ,
3224+ ( ErrorContext , b) => bail ! ( offset, "expected {}, found error-context " , b. desc( ) ) ,
32253225 }
32263226 }
32273227
0 commit comments