Skip to content

Conversation

@kanarus
Copy link
Contributor

@kanarus kanarus commented Aug 2, 2025

Fixing warnings generated by current nio v0.0.1:

cargo check
warning: lifetime flowing from input to output with different syntax can be confusing
  --> libs/mpmc-channel/src/lib.rs:46:20
   |
46 |     pub fn produce(&self) -> Producer<T> {
   |                    ^^^^^     ----------- the lifetime gets resolved as `'_`
   |                    |
   |                    this lifetime flows to the output
   |
   = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
46 |     pub fn produce(&self) -> Producer<'_, T> {
   |                                       +++

warning: lifetime flowing from input to output with different syntax can be confusing
  --> libs/mpmc-channel/src/lib.rs:55:20
   |
55 |     pub fn consume(&self) -> Consume<T> {
   |                    ^^^^^     ---------- the lifetime gets resolved as `'_`
   |                    |
   |                    this lifetime flows to the output
   |
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
55 |     pub fn consume(&self) -> Consume<'_, T> {
   |                                      +++

warning: lifetime flowing from input to output with different syntax can be confusing
  --> libs/mpmc-channel/src/lib.rs:63:24
   |
63 |     pub fn try_produce(&self) -> Result<Producer<T>, WouldBlock> {
   |                        ^^^^^            ----------- the lifetime gets resolved as `'_`
   |                        |
   |                        this lifetime flows to the output
   |
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
63 |     pub fn try_produce(&self) -> Result<Producer<'_, T>, WouldBlock> {
   |                                                  +++

warning: lifetime flowing from input to output with different syntax can be confusing
  --> libs/mpmc-channel/src/lib.rs:75:24
   |
75 |     pub fn try_consume(&self) -> Result<Consume<T>, WouldBlock> {
   |                        ^^^^^            ---------- the lifetime gets resolved as `'_`
   |                        |
   |                        this lifetime flows to the output
   |
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
75 |     pub fn try_consume(&self) -> Result<Consume<'_, T>, WouldBlock> {
   |                                                 +++

warning: `mpmc-channel` (lib) generated 4 warnings
warning: lifetime flowing from input to output with different syntax can be confusing
   --> src/net/tcp/stream.rs:138:18
    |
138 |     pub fn split(&mut self) -> (ReadHalf, WriteHalf) {
    |                  ^^^^^^^^^      --------  --------- the lifetimes get resolved as `'_`
    |                  |              |
    |                  |              the lifetimes get resolved as `'_`
    |                  this lifetime flows to the output
    |
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
    |
138 |     pub fn split(&mut self) -> (ReadHalf<'_>, WriteHalf<'_>) {
    |                                         ++++           ++++

warning: lifetime flowing from input to output with different syntax can be confusing
  --> src/net/tcp/split.rs:24:22
   |
24 | pub fn split(stream: &mut TcpStream) -> (ReadHalf, WriteHalf) {
   |                      ^^^^^^^^^^^^^^      --------  --------- the lifetimes get resolved as `'_`
   |                      |                   |
   |                      |                   the lifetimes get resolved as `'_`
   |                      this lifetime flows to the output
   |
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
24 | pub fn split(stream: &mut TcpStream) -> (ReadHalf<'_>, WriteHalf<'_>) {
   |                                                  ++++           ++++

warning: lifetime flowing from input to output with different syntax can be confusing
  --> src/runtime/handle.rs:58:18
   |
58 |     pub fn enter(&self) -> EnterGuard {
   |                  ^^^^^     ---------- the lifetime gets resolved as `'_`
   |                  |
   |                  this lifetime flows to the output
   |
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
58 |     pub fn enter(&self) -> EnterGuard<'_> {
   |                                      ++++

warning: lifetime flowing from input to output with different syntax can be confusing
  --> src/runtime/multithread/mod.rs:73:18
   |
73 |     pub fn enter(&self) -> EnterGuard {
   |                  ^^^^^     ---------- the lifetime gets resolved as `'_`
   |                  |
   |                  this lifetime flows to the output
   |
help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
   |
73 |     pub fn enter(&self) -> EnterGuard<'_> {
   |                                      ++++

warning: `nio` (lib) generated 4 warnings
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s

@nurmohammed840
Copy link
Owner

nurmohammed840 commented Aug 2, 2025

Thanks!

There is a bug in IO (mio) stack, that sometime cause deadlock in test suite (specific), I can't reproduce it,
Current implementation closely followed Tokio implementation of network API. Which may causing that issue.

But in future, I am planning to re-implement network API, which hopefully solve this problem.

Anyways thanks again!

@nurmohammed840 nurmohammed840 merged commit 3423aaf into nurmohammed840:main Aug 2, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants