-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unstable ErrorKind in Stable branch #6650
Comments
Seems that this is a sync problem between stable and nightly use of |
Tokio will often rely on the standard library for various kinds of logic, and when we do so, we are subject to the choices that the standard library makes. There isn't anything we can do about it. Closing as wont-fix. |
Version
1.38
Platform
Linux 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Description
Using a crate
tokio-modbus
which uses TcpStream to connect to a client. If this client isn't available (like the device is offline) I get the error:Os { code: 113, kind: HostUnreachable, message: "No route to host" }
Looking up this "kind" is points me to rust-lang/rust#86442
https://github.com/rust-lang/rust/blob/a9c8887c7d548abc6c3e87f7d6fa02a0e95880bd/library/std/src/io/error.rs#L229-L230
This error is in the unstable branch. Why does
TcpStream::connect()
use this when I don't use the nightly?tokio = { version = "1", features = ["full"] }
I couldn't actually find where this ErrorKind variant is throw aside from
tokio/tokio/src/net/tcp/socket.rs
Lines 638 to 641 in 9a75d6f
I expected to see this happen:
See one of the stable io::Error::ErrorKinds:
or the like
The one that's being returned is appropriate but I cannot use it if i want to continue to use stable.
Instead, this happened:
Os { code: 113, kind: HostUnreachable, message: "No route to host" }
The text was updated successfully, but these errors were encountered: