ITADN

'monoio::pin!' is deprecated, but 'monoio::select!' doesn't support 'std::pin::pin!' / 'monoio::pin!' 已被废弃,但 'monoio::select!' 不支持 'std::pin::pin!'

#367Closedi18nsite 创建于 2025-09-30
I
i18nsitecommented
'monoio::pin!' is deprecated, but 'monoio::select!' doesn't support 'std::pin::pin!' monoio::pin!' 已被废弃,但 'monoio::select!' 不支持 'std::pin::pin!' 有飞书群吗? ``` ❯ cargo b Compiling mgate_srv v0.1.0 (/Users/z/i18n/mgate/mgate_srv) error[E0599]: the method `poll` exists for struct `Pin<&mut &mut F>`, but its trait bounds were not satisfied --> mgate_srv/src/http_redirect_https.rs:33:5 | 33 | / monoio::select! { 34 | | res = listener.accept() => { 35 | | match res { 36 | | Ok((stream, _addr)) => { ... | 48 | | } | |_____^ method cannot be called on `Pin<&mut &mut F>` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `F: Unpin` which is required by `&mut F: std::future::Future` = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `poll`, perhaps you need to implement it: candidate #1: `std::future::Future` = note: this error originates in the macro `$crate::select` which comes from the expansion of the macro `monoio::select` (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try `rustc --explain E0599`. error: could not compile `mgate_srv` (lib) due to 1 previous error ❯ cargo b Compiling mgate_srv v0.1.0 (/Users/z/i18n/mgate/mgate_srv) warning: use of deprecated macro `monoio::pin`: use std::pin::pin instead --> mgate_srv/src/http_redirect_https.rs:30:3 | 30 | monoio::pin!(shutdown); | ^^^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default warning: `mgate_srv` (lib) generated 1 warning Compiling mgate v0.1.2 (/Users/z/i18n/mgate/mgate) Finished `dev` profile [optimized + debuginfo] target(s) in 0.95s ```
关闭于 2025-09-30 1 条评论