Repository: bytecodealliance/wasm-tools
Pull request #2066 (2025-02-24 18:53:07)

Rename `task.yield` to `yield`
Catching up to WebAssembly/component-model#438 a bit


Patch:
diff --git a/crates/wasm-encoder/src/component/builder.rs b/crates/wasm-encoder/src/component/builder.rs
index e95dd060..06b78b64 100644
--- a/crates/wasm-encoder/src/component/builder.rs
+++ b/crates/wasm-encoder/src/component/builder.rs
@@ -408,8 +408,8 @@ impl ComponentBuilder {
     }
 
     /// Declares a new `task.yield` intrinsic.
-    pub fn task_yield(&mut self, async_: bool) -> u32 {
-        self.canonical_functions().task_yield(async_);
+    pub fn yield_(&mut self, async_: bool) -> u32 {
+        self.canonical_functions().yield_(async_);
         inc(&mut self.core_funcs)
     }
 
diff --git a/crates/wasm-encoder/src/component/canonicals.rs b/crates/wasm-encoder/src/component/canonicals.rs
index 4a757199..a20fae46 100644
--- a/crates/wasm-encoder/src/component/canonicals.rs
+++ b/crates/wasm-encoder/src/component/canonicals.rs
@@ -204,7 +204,7 @@ impl CanonicalFunctionSection {
     /// are able to make progress, if any.
     ///
     /// If `async_` is true, the caller instance may be reentered.
-    pub fn task_yield(&mut self, async_: bool) -> &mut Self {
+    pub fn yield_(&mut self, async_: bool) -> &mut Self {
         self.bytes.push(0x0c);
         self.bytes.push(if async_ { 1 } else { 0 });
         self.num_added += 1;
diff --git a/crates/wasm-encoder/src/reencode/component.rs b/crates/wasm-encoder/src/reencode/component.rs
index fa34b5e4..bbeecb3e 100644
--- a/crates/wasm-encoder/src/reencode/component.rs
+++ b/crates/wasm-encoder/src/reencode/component.rs
@@ -969,8 +969,8 @@ pub mod component_utils {
                     options.iter().map(|o| reencoder.canonical_option(*o)),
                 );
             }
-            wasmparser::CanonicalFunction::TaskYield { async_ } => {
-                section.task_yield(async_);
+            wasmparser::CanonicalFunction::Yield { async_ } => {
+                section.yield_(async_);
             }
             wasmparser::CanonicalFunction::SubtaskDrop => {
                 section.subtask_drop();
diff --git a/crates/wasmparser/src/readers/component/canonicals.rs b/crates/wasmparser/src/readers/component/canonicals.rs
index 47324df6..5a7be8b1 100644
--- a/crates/wasmparser/src/readers/component/canonicals.rs
+++ b/crates/wasmparser/src/readers/component/canonicals.rs
@@ -92,7 +92,7 @@ pub enum CanonicalFunction {
     },
     /// A function which yields control to the host so that other tasks are able
     /// to make progress, if any.
-    TaskYield {
+    Yield {
         /// If `true`, indicates the caller instance maybe reentered.
         async_: bool,
     },
@@ -282,7 +282,7 @@ impl<'a> FromReader<'a> for CanonicalFunction {
                 result: crate::read_resultlist(reader)?,
                 options: read_opts(reader)?,
             },
-            0x0c => CanonicalFunction::TaskYield {
+            0x0c => CanonicalFunction::Yield {
                 async_: reader.read()?,
             },
             0x0d => CanonicalFunction::SubtaskDrop,
diff --git a/crates/wasmparser/src/validator/component.rs b/crates/wasmparser/src/validator/component.rs
index d6577352..62b855c0 100644
--- a/crates/wasmparser/src/validator/component.rs
+++ b/crates/wasmparser/src/validator/component.rs
@@ -997,9 +997,7 @@ impl ComponentState {
             CanonicalFunction::TaskReturn { result, options } => {
                 self.task_return(&result, &options, types, offset, features)
             }
-            CanonicalFunction::TaskYield { async_ } => {
-                self.task_yield(async_, types, offset, features)
-            }
+            CanonicalFunction::Yield { async_ } => self.yield_(async_, types, offset, features),
             CanonicalFunction::SubtaskDrop => self.subtask_drop(types, offset, features),
             CanonicalFunction::StreamNew { ty } => self.stream_new(ty, types, offset, features),
             CanonicalFunction::StreamRead { ty, options } => {
@@ -1249,7 +1247,7 @@ impl ComponentState {
         Ok(())
     }
 
-    fn task_yield(
+    fn yield_(
         &mut self,
         _async_: bool,
         types: &mut TypeAlloc,
@@ -1257,10 +1255,7 @@ impl ComponentState {
         features: &WasmFeatures,
     ) -> Result<()> {
         if !features.component_model_async() {
-            bail!(
-                offset,
-                "`task.yield` requires the component model async feature"
-            )
+            bail!(offset, "`yield` requires the component model async feature")
         }
 
         self.core_funcs
diff --git a/crates/wasmprinter/src/component.rs b/crates/wasmprinter/src/component.rs
index 5913dc0f..d3664de4 100644
--- a/crates/wasmprinter/src/component.rs
+++ b/crates/wasmprinter/src/component.rs
@@ -800,7 +800,7 @@ impl Printer<'_, '_> {
                     self.print_idx(&state.core.func_names, *idx)?;
                     self.end_group()?;
                 }
-                CanonicalOption::Async => self.result.write_str("async")?,
+                CanonicalOption::Async => self.print_type_keyword("async")?,
                 CanonicalOption::Callback(idx) => {
                     self.start_group("callback ")?;
                     self.print_idx(&state.core.func_names, *idx)?;
@@ -928,10 +928,10 @@ impl Printer<'_, '_> {
                         Ok(())
                     })?;
                 }
-                CanonicalFunction::TaskYield { async_ } => {
-                    self.print_intrinsic(state, "canon task.yield", &|me, _| {
+                CanonicalFunction::Yield { async_ } => {
+                    self.print_intrinsic(state, "canon yield", &|me, _| {
                         if async_ {
-                            me.result.write_str(" async")?;
+                            me.print_type_keyword(" async")?;
                         }
                         Ok(())
                     })?;
@@ -960,7 +960,7 @@ impl Printer<'_, '_> {
                     self.print_intrinsic(state, "canon stream.cancel-read ", &|me, state| {
                         me.print_idx(&state.component.type_names, ty)?;
                         if async_ {
-                            me.result.write_str(" async")?;
+                            me.print_type_keyword(" async")?;
                         }
                         Ok(())
                     })?;
@@ -969,7 +969,7 @@ impl Printer<'_, '_> {
                     self.print_intrinsic(state, "canon stream.cancel-write ", &|me, state| {
                         me.print_idx(&state.component.type_names, ty)?;
                         if async_ {
-                            me.result.write_str(" async")?;
+                            me.print_type_keyword(" async")?;
                         }
                         Ok(())
                     })?;
@@ -1005,7 +1005,7 @@ impl Printer<'_, '_> {
                     self.print_intrinsic(state, "canon future.cancel-read ", &|me, state| {
                         me.print_idx(&state.component.type_names, ty)?;
                         if async_ {
-                            me.result.write_str(" async")?;
+                            me.print_type_keyword(" async")?;
                         }
                         Ok(())
                     })?;
@@ -1014,7 +1014,7 @@ impl Printer<'_, '_> {
                     self.print_intrinsic(state, "canon future.cancel-write ", &|me, state| {
                         me.print_idx(&state.component.type_names, ty)?;
                         if async_ {
-                            me.result.write_str(" async")?;
+                            me.print_type_keyword(" async")?;
                         }
                         Ok(())
                     })?;
diff --git a/crates/wast/src/component/binary.rs b/crates/wast/src/component/binary.rs
index 423644db..1598c6aa 100644
--- a/crates/wast/src/component/binary.rs
+++ b/crates/wast/src/component/binary.rs
@@ -370,9 +370,9 @@ impl<'a> Encoder<'a> {
                     info.opts.iter().map(Into::into),
                 );
             }
-            CanonicalFuncKind::TaskYield(info) => {
+            CanonicalFuncKind::Yield(info) => {
                 self.core_func_names.push(name);
-                self.funcs.task_yield(info.async_);
+                self.funcs.yield_(info.async_);
             }
             CanonicalFuncKind::SubtaskDrop => {
                 self.core_func_names.push(name);
diff --git a/crates/wast/src/component/expand.rs b/crates/wast/src/component/expand.rs
index 611dfbc8..30e65117 100644
--- a/crates/wast/src/component/expand.rs
+++ b/crates/wast/src/component/expand.rs
@@ -330,11 +330,11 @@ impl<'a> Expander<'a> {
                 name: func.name,
                 kind: CanonicalFuncKind::TaskReturn(info),
             }),
-            CoreFuncKind::TaskYield(info) => ComponentField::CanonicalFunc(CanonicalFunc {
+            CoreFuncKind::Yield(info) => ComponentField::CanonicalFunc(CanonicalFunc {
                 span: func.span,
                 id: func.id,
                 name: func.name,
-                kind: CanonicalFuncKind::TaskYield(info),
+                kind: CanonicalFuncKind::Yield(info),
             }),
             CoreFuncKind::SubtaskDrop => ComponentField::CanonicalFunc(CanonicalFunc {
                 span: func.span,
diff --git a/crates/wast/src/component/func.rs b/crates/wast/src/component/func.rs
index 5bd45222..680f7e06 100644
--- a/crates/wast/src/component/func.rs
+++ b/crates/wast/src/component/func.rs
@@ -55,7 +55,7 @@ pub enum CoreFuncKind<'a> {
     ThreadAvailableParallelism(CanonThreadAvailableParallelism),
     BackpressureSet,
     TaskReturn(CanonTaskReturn<'a>),
-    TaskYield(CanonTaskYield),
+    Yield(CanonYield),
     SubtaskDrop,
     StreamNew(CanonStreamNew<'a>),
     StreamRead(CanonStreamRead<'a>),
@@ -110,8 +110,8 @@ impl<'a> Parse<'a> for CoreFuncKind<'a> {
                 Ok(CoreFuncKind::BackpressureSet)
             } else if l.peek::<kw::task_return>()? {
                 Ok(CoreFuncKind::TaskReturn(parser.parse()?))
-            } else if l.peek::<kw::task_yield>()? {
-                Ok(CoreFuncKind::TaskYield(parser.parse()?))
+            } else if l.peek::<kw::yield_>()? {
+                Ok(CoreFuncKind::Yield(parser.parse()?))
             } else if l.peek::<kw::subtask_drop>()? {
                 parser.parse::<kw::subtask_drop>()?;
                 Ok(CoreFuncKind::SubtaskDrop)
@@ -357,7 +357,7 @@ pub enum CanonicalFuncKind<'a> {
 
     BackpressureSet,
     TaskReturn(CanonTaskReturn<'a>),
-    TaskYield(CanonTaskYield),
+    Yield(CanonYield),
     SubtaskDrop,
     StreamNew(CanonStreamNew<'a>),
     StreamRead(CanonStreamRead<'a>),
@@ -611,15 +611,15 @@ impl<'a> Parse<'a> for CanonWaitableSetPoll<'a> {
 
 /// Information relating to the `task.yield` intrinsic.
 #[derive(Debug)]
-pub struct CanonTaskYield {
+pub struct CanonYield {
     /// If true, the component instance may be reentered during a call to this
     /// intrinsic.
     pub async_: bool,
 }
 
-impl<'a> Parse<'a> for CanonTaskYield {
+impl<'a> Parse<'a> for CanonYield {
     fn parse(parser: Parser<'a>) -> Result<Self> {
-        parser.parse::<kw::task_yield>()?;
+        parser.parse::<kw::yield_>()?;
         let async_ = parser.parse::<Option<kw::r#async>>()?.is_some();
 
         Ok(Self { async_ })
diff --git a/crates/wast/src/component/resolve.rs b/crates/wast/src/component/resolve.rs
index f3ff0a1d..916efc4e 100644
--- a/crates/wast/src/component/resolve.rs
+++ b/crates/wast/src/component/resolve.rs
@@ -388,7 +388,7 @@ impl<'a> Resolver<'a> {
             }
             CanonicalFuncKind::ThreadAvailableParallelism(_)
             | CanonicalFuncKind::BackpressureSet
-            | CanonicalFuncKind::TaskYield(_)
+            | CanonicalFuncKind::Yield(_)
             | CanonicalFuncKind::SubtaskDrop
             | CanonicalFuncKind::ErrorContextDrop => {}
             CanonicalFuncKind::TaskReturn(info) => {
@@ -971,7 +971,7 @@ impl<'a> ComponentState<'a> {
                 | CanonicalFuncKind::ThreadAvailableParallelism(_)
                 | CanonicalFuncKind::BackpressureSet
                 | CanonicalFuncKind::TaskReturn(_)
-                | CanonicalFuncKind::TaskYield(_)
+                | CanonicalFuncKind::Yield(_)
                 | CanonicalFuncKind::SubtaskDrop
                 | CanonicalFuncKind::StreamNew(_)
                 | CanonicalFuncKind::StreamRead(_)
diff --git a/crates/wast/src/lib.rs b/crates/wast/src/lib.rs
index 9f294891..effe7729 100644
--- a/crates/wast/src/lib.rs
+++ b/crates/wast/src/lib.rs
@@ -558,7 +558,7 @@ pub mod kw {
     custom_keyword!(thread_available_parallelism = "thread.available_parallelism");
     custom_keyword!(backpressure_set = "backpressure.set");
     custom_keyword!(task_return = "task.return");
-    custom_keyword!(task_yield = "task.yield");
+    custom_keyword!(yield_ = "yield");
     custom_keyword!(subtask_drop = "subtask.drop");
     custom_keyword!(stream_new = "stream.new");
     custom_keyword!(stream_read = "stream.read");
diff --git a/crates/wit-component/src/encoding.rs b/crates/wit-component/src/encoding.rs
index b504b458..6d609c9e 100644
--- a/crates/wit-component/src/encoding.rs
+++ b/crates/wit-component/src/encoding.rs
@@ -1652,8 +1652,8 @@ impl<'a> EncodingState<'a> {
                 Ok(self
                     .materialize_shim_import(shims, &ShimKind::WaitableSetPoll { async_: *async_ }))
             }
-            Import::TaskYield { async_ } => {
-                let index = self.component.task_yield(*async_);
+            Import::Yield { async_ } => {
+                let index = self.component.yield_(*async_);
                 Ok((ExportKind::Func, index))
             }
             Import::SubtaskDrop => {
@@ -2144,7 +2144,7 @@ impl<'a> Shims<'a> {
                 | Import::ExportedResourceNew(..)
                 | Import::ErrorContextDrop
                 | Import::BackpressureSet
-                | Import::TaskYield { .. }
+                | Import::Yield { .. }
                 | Import::SubtaskDrop
                 | Import::FutureNew(..)
                 | Import::StreamNew(..)
diff --git a/crates/wit-component/src/validation.rs b/crates/wit-component/src/validation.rs
index 3dc2ad76..bd906fdb 100644
--- a/crates/wit-component/src/validation.rs
+++ b/crates/wit-component/src/validation.rs
@@ -284,11 +284,11 @@ pub enum Import {
     /// A `waitable.join` intrinsic.
     WaitableJoin,
 
-    /// A `canon task.wait` intrinsic.
+    /// A `canon yield` intrinsic.
     ///
     /// This allows the guest to yield (e.g. during an computationally-intensive
     /// operation) and allow other subtasks to make progress.
-    TaskYield { async_: bool },
+    Yield { async_: bool },
 
     /// A `canon subtask.drop` intrinsic.
     ///
@@ -610,10 +610,11 @@ impl ImportMap {
                 return Ok(Import::WaitableJoin);
             }
 
-            if Some(name) == names.task_yield() {
+            if Some(name) == names.yield_() {
+                validate_not_async()?;
                 let expected = FuncType::new([], []);
                 validate_func_sig(name, &expected, ty)?;
-                return Ok(Import::TaskYield {
+                return Ok(Import::Yield {
                     async_: abi == AbiVariant::GuestImportAsync,
                 });
             }
@@ -1413,7 +1414,7 @@ trait NameMangling {
     fn waitable_set_poll(&self) -> Option<&str>;
     fn waitable_set_drop(&self) -> Option<&str>;
     fn waitable_join(&self) -> Option<&str>;
-    fn task_yield(&self) -> Option<&str>;
+    fn yield_(&self) -> Option<&str>;
     fn subtask_drop(&self) -> Option<&str>;
     fn callback_name<'a>(&self, s: &'a str) -> Option<&'a str>;
     fn async_name<'a>(&self, s: &'a str) -> Option<&'a str>;
@@ -1500,7 +1501,7 @@ impl NameMangling for Standard {
     fn waitable_join(&self) -> Option<&str> {
         None
     }
-    fn task_yield(&self) -> Option<&str> {
+    fn yield_(&self) -> Option<&str> {
         None
     }
     fn subtask_drop(&self) -> Option<&str> {
@@ -1685,8 +1686,8 @@ impl NameMangling for Legacy {
     fn waitable_join(&self) -> Option<&str> {
         Some("[waitable-join]")
     }
-    fn task_yield(&self) -> Option<&str> {
-        Some("[task-yield]")
+    fn yield_(&self) -> Option<&str> {
+        Some("[yield]")
     }
     fn subtask_drop(&self) -> Option<&str> {
         Some("[subtask-drop]")
diff --git a/src/bin/wasm-tools/dump.rs b/src/bin/wasm-tools/dump.rs
index ad06ffe1..49bde121 100644
--- a/src/bin/wasm-tools/dump.rs
+++ b/src/bin/wasm-tools/dump.rs
@@ -428,7 +428,7 @@ impl<'a> Dump<'a> {
                             | CanonicalFunction::WaitableSetPoll { .. }
                             | CanonicalFunction::WaitableSetDrop
                             | CanonicalFunction::WaitableJoin
-                            | CanonicalFunction::TaskYield { .. }
+                            | CanonicalFunction::Yield { .. }
                             | CanonicalFunction::SubtaskDrop
                             | CanonicalFunction::StreamNew { .. }
                             | CanonicalFunction::StreamRead { .. }


Test patch:
diff --git a/crates/wit-component/tests/components/async-builtins/component.wat b/crates/wit-component/tests/components/async-builtins/component.wat
index ae1c15d6..e7003544 100644
--- a/crates/wit-component/tests/components/async-builtins/component.wat
+++ b/crates/wit-component/tests/components/async-builtins/component.wat
@@ -14,7 +14,7 @@
     (import "$root" "[waitable-set-poll]" (func (;5;) (type 3)))
     (import "$root" "[waitable-set-drop]" (func (;6;) (type 0)))
     (import "$root" "[waitable-join]" (func (;7;) (type 1)))
-    (import "$root" "[task-yield]" (func (;8;) (type 4)))
+    (import "$root" "[yield]" (func (;8;) (type 4)))
     (import "$root" "[subtask-drop]" (func (;9;) (type 0)))
     (import "$root" "[error-context-new;encoding=utf8]" (func (;10;) (type 3)))
     (import "$root" "[error-context-debug-message;encoding=utf8;realloc=cabi_realloc]" (func (;11;) (type 1)))
@@ -105,7 +105,7 @@
   (alias core export 0 "1" (core func (;3;)))
   (core func (;4;) (canon waitable-set.drop))
   (core func (;5;) (canon waitable.join))
-  (core func (;6;) (canon task.yield))
+  (core func (;6;) (canon yield))
   (core func (;7;) (canon subtask.drop))
   (alias core export 0 "2" (core func (;8;)))
   (alias core export 0 "3" (core func (;9;)))
@@ -117,7 +117,7 @@
     (export "[waitable-set-poll]" (func 3))
     (export "[waitable-set-drop]" (func 4))
     (export "[waitable-join]" (func 5))
-    (export "[task-yield]" (func 6))
+    (export "[yield]" (func 6))
     (export "[subtask-drop]" (func 7))
     (export "[error-context-new;encoding=utf8]" (func 8))
     (export "[error-context-debug-message;encoding=utf8;realloc=cabi_realloc]" (func 9))
diff --git a/crates/wit-component/tests/components/async-builtins/module.wat b/crates/wit-component/tests/components/async-builtins/module.wat
index 8c100741..c7375ccf 100644
--- a/crates/wit-component/tests/components/async-builtins/module.wat
+++ b/crates/wit-component/tests/components/async-builtins/module.wat
@@ -7,7 +7,7 @@
   (import "$root" "[waitable-set-poll]" (func (param i32 i32) (result i32)))
   (import "$root" "[waitable-set-drop]" (func (param i32)))
   (import "$root" "[waitable-join]" (func (param i32 i32)))
-  (import "$root" "[task-yield]" (func))
+  (import "$root" "[yield]" (func))
   (import "$root" "[subtask-drop]" (func (param i32)))
   (import "$root" "[error-context-new;encoding=utf8]" (func (param i32 i32) (result i32)))
   (import "$root" "[error-context-debug-message;encoding=utf8;realloc=cabi_realloc]" (func (param i32 i32)))
diff --git a/tests/local/component-model-async/task-builtins.wast b/tests/local/component-model-async/task-builtins.wast
index 2066bd1a..b63ea92c 100644
--- a/tests/local/component-model-async/task-builtins.wast
+++ b/tests/local/component-model-async/task-builtins.wast
@@ -160,25 +160,25 @@
   "type mismatch for export `waitable.join` of module instantiation argument ``"
 )
 
-;; task.yield
+;; yield
 (component
   (core module $m
-    (import "" "task.yield" (func $task-yield))
+    (import "" "yield" (func $yield))
   )
-  (core func $task-yield (canon task.yield async))
-  (core instance $i (instantiate $m (with "" (instance (export "task.yield" (func $task-yield))))))
+  (core func $yield (canon yield async))
+  (core instance $i (instantiate $m (with "" (instance (export "yield" (func $yield))))))
 )
 
-;; task.yield; incorrect type
+;; yield; incorrect type
 (assert_invalid
   (component
     (core module $m
-      (import "" "task.yield" (func $task-yield (param i32) (result i32)))
+      (import "" "yield" (func $yield (param i32) (result i32)))
     )
-    (core func $task-yield (canon task.yield async))
-    (core instance $i (instantiate $m (with "" (instance (export "task.yield" (func $task-yield))))))
+    (core func $yield (canon yield async))
+    (core instance $i (instantiate $m (with "" (instance (export "yield" (func $yield))))))
   )
-  "type mismatch for export `task.yield` of module instantiation argument ``"
+  "type mismatch for export `yield` of module instantiation argument ``"
 )
 
 ;; subtask.drop
diff --git a/tests/local/missing-features/component-model/async.wast b/tests/local/missing-features/component-model/async.wast
index 5d0c51fe..000f9561 100644
--- a/tests/local/missing-features/component-model/async.wast
+++ b/tests/local/missing-features/component-model/async.wast
@@ -98,16 +98,16 @@
   "`waitable.join` requires the component model async feature"
 )
 
-;; task.yield
+;; yield
 (assert_invalid
   (component
     (core module $m
-      (import "" "task.yield" (func $task-yield))
+      (import "" "yield" (func $yield))
     )
-    (core func $task-yield (canon task.yield async))
-    (core instance $i (instantiate $m (with "" (instance (export "task.yield" (func $task-yield))))))
+    (core func $yield (canon yield async))
+    (core instance $i (instantiate $m (with "" (instance (export "yield" (func $yield))))))
   )
-  "`task.yield` requires the component model async feature"
+  "`yield` requires the component model async feature"
 )
 
 ;; subtask.drop
diff --git a/tests/snapshots/local/component-model-async/task-builtins.wast.json b/tests/snapshots/local/component-model-async/task-builtins.wast.json
index 5ee53942..688b2f8e 100644
--- a/tests/snapshots/local/component-model-async/task-builtins.wast.json
+++ b/tests/snapshots/local/component-model-async/task-builtins.wast.json
@@ -123,7 +123,7 @@
       "line": 174,
       "filename": "task-builtins.18.wasm",
       "module_type": "binary",
-      "text": "type mismatch for export `task.yield` of module instantiation argument ``"
+      "text": "type mismatch for export `yield` of module instantiation argument ``"
     },
     {
       "type": "module",
diff --git a/tests/snapshots/local/component-model-async/task-builtins.wast/17.print b/tests/snapshots/local/component-model-async/task-builtins.wast/17.print
index 0851c2de..7034e8c4 100644
--- a/tests/snapshots/local/component-model-async/task-builtins.wast/17.print
+++ b/tests/snapshots/local/component-model-async/task-builtins.wast/17.print
@@ -1,11 +1,11 @@
 (component
   (core module $m (;0;)
     (type (;0;) (func))
-    (import "" "task.yield" (func $task-yield (;0;) (type 0)))
+    (import "" "yield" (func $yield (;0;) (type 0)))
   )
-  (core func $task-yield (;0;) (canon task.yield async))
+  (core func $yield (;0;) (canon yield async))
   (core instance (;0;)
-    (export "task.yield" (func $task-yield))
+    (export "yield" (func $yield))
   )
   (core instance $i (;1;) (instantiate $m
       (with "" (instance 0))
diff --git a/tests/snapshots/local/missing-features/component-model/async.wast.json b/tests/snapshots/local/missing-features/component-model/async.wast.json
index b80ec6bf..407b1fce 100644
--- a/tests/snapshots/local/missing-features/component-model/async.wast.json
+++ b/tests/snapshots/local/missing-features/component-model/async.wast.json
@@ -69,7 +69,7 @@
       "line": 103,
       "filename": "async.9.wasm",
       "module_type": "binary",
-      "text": "`task.yield` requires the component model async feature"
+      "text": "`yield` requires the component model async feature"
     },
     {
       "type": "assert_invalid",