Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

快速开始教程无法编译 #257

Closed
liuzsen opened this issue Nov 6, 2023 · 2 comments
Closed

快速开始教程无法编译 #257

liuzsen opened this issue Nov 6, 2023 · 2 comments

Comments

@liuzsen
Copy link

liuzsen commented Nov 6, 2023

Bug Report

Version

Platform

Crates

Description

新手教程中的步骤,编译失败,输出如下

error[E0277]: `dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send` is not a future
   --> /home/sen/code/volo-play/volo-example/target/debug/build/volo-gen-2f3f6b511768088d/out/volo_gen.rs:166:22
    |
166 |                   ) -> ::std::pin::Pin<
    |  ______________________^
167 | |                     ::std::boxed::Box<
168 | |                         dyn ::std::future::Future<
169 | |                                 Output = ::std::result::Result<Self, ::pilota::thrift::DecodeError>,
...   |
172 | |                     >,
173 | |                 > {
    | |_________________^ `dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send` is not a future
    |
    = help: the trait `Future` is not implemented for `dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send`
    = note: dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send must be a future or must implement `IntoFuture` to be awaited
    = note: required for `Pin<Box<dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send>>` to implement `Future`
note: required by a bound in `volo_thrift::Message::{opaque#0}`
   --> /home/sen/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/pilota-0.9.0/src/thrift/mod.rs:46:22
    |
46  |     ) -> impl Future<Output = Result<Self, DecodeError>> + Send;
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Message::{opaque#0}`

error[E0277]: `dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send` cannot be sent between threads safely
   --> /home/sen/code//volo-play/volo-example/target/debug/build/volo-gen-2f3f6b511768088d/out/volo_gen.rs:166:22
    |
166 |                   ) -> ::std::pin::Pin<
    |  ______________________^
167 | |                     ::std::boxed::Box<
168 | |                         dyn ::std::future::Future<
169 | |                                 Output = ::std::result::Result<Self, ::pilota::thrift::DecodeError>,
...   |
172 | |                     >,
173 | |                 > {
    | |_________________^ `dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send` cannot be sent between threads safely
    |
    = help: the trait `Send` is not implemented for `dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send`
    = note: required for `std::ptr::Unique<dyn Future<Output = Result<Item, pilota::thrift::DecodeError>> + Send>` to implement `Send`
note: required because it appears within the type `Box<dyn Future<Output = Result<Item, DecodeError>> + Send>`
   --> /home/sen/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:195:12
    |
195 | pub struct Box<
    |            ^^^
note: required because it appears within the type `Pin<Box<dyn Future<Output = Result<Item, DecodeError>> + Send>>`
   --> /home/sen/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/pin.rs:410:12

rust 版本:

(base) [sen@OP005 volo-example]$ rustup --version 
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.75.0-nightly (fee5518cd 2023-11-05)`
@PureWhiteWu
Copy link
Member

你好,这个问题已知,是由于 nightly 11-04 版本中引入的问题,你可以先在 rust-toolchain.toml 中指定版本为 2023-11-03 使用。
Rust 相关 issue:rust-lang/rust#117602

@liuzsen liuzsen closed this as completed Nov 7, 2023
@liuzsen
Copy link
Author

liuzsen commented Nov 7, 2023

好的,谢谢,问题解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants