wit_future FuturePayload implemented for wrong type
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Reproduce the report using the src/lib.rs example and inspect the generated bindings with cargo expand. Compare the FuturePayload implementations for imported and exported ErrorCode types; done means the exported future<result<_, error-code>> methods compile without a manual trait implementation.
索引モデルが issue の本文から書いたものです。
説明
Using wit-bindgen 0.57.1, I'm implementing a component that interposes wasi:[email protected]. Both send and receive on tcp-socket use the return type future<result<_, error-code>>. When implementing these methods, I get the error:
error[E0277]: the trait bound `Result<_, exports::wasi::sockets::types::ErrorCode>: FuturePayload` is not satisfied
--> src/lib.rs:325:40
|
325 | let (tx, rx) = wit_future::new(|| Err(ErrorCode::Other(None)));
| --------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FuturePayload` is not implemented for `Result<_, exports::wasi::sockets::types::ErrorCode>`
| |
| required by a bound introduced by this call
|
help: the trait `FuturePayload` is implemented for `Result<(), wasi::sockets::types::ErrorCode>`
The FuturePayload trait is implemented for the imported type, but not implemented for the exported type.
If I manually implement the trait for the exported type using the output of cargo expand, replacing the ErrorCode type with the exports version, everything compiles as expected.
The project as a whole is a work in progress, but I can push the code if that helps.
- 主要言語
- Rust
- スター
- 1.5k
- フォーク
- 306
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 21
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/wit-bindgen のほかの issue
-
gen-rust
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bytecodealliance/wit-bindgen#1791 ·
メンテナーはふだん 1 日以内に返信
-
gen-rust
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
bytecodealliance/wit-bindgen#1790 ·
メンテナーはふだん 1 日以内に返信
-
gen-rust
難易度 3/5 半日 初心者へのやさしさ 55/100
bytecodealliance/wit-bindgen#1787 ·
メンテナーはふだん 1 日以内に返信
-
gen-c#
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
bytecodealliance/wit-bindgen#1759 ·
メンテナーはふだん 1 日以内に返信
-
Async exports never free the block of indirect parameters対応中かも @Aditya1404Sal が 37 日前に担当しました。 オープンasync
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
bytecodealliance/wit-bindgen#1757 ·
メンテナーはふだん 1 日以内に返信
bytecodealliance/wit-bindgen の issue をすべて見る
似ている issue
-
lane:collections todo:ticket
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/designcraft#3662 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Nixitov/Riptide-Native#521 ·
メンテナーはふだん 1 日以内に返信