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

Warning: Contains Code That Will Become an Error in a Future Release of Rust #277

Open
DanteVillarreal opened this issue Oct 18, 2023 · 3 comments

Comments

@DanteVillarreal
Copy link

[hyper 0.10.15] (https://github.com/hyperium/hyper/blob/0.10.x/Cargo.toml), which depends on traitobject 0.1.0 "contains code that will become an error in future versions of rust."

I was making a websocket client in your awesome crate, and after many days of working at it, I finally got it to work. Thank God. However, upon further inspection, I got a warning. To my surprise, it wasn't in my own code. It was from one of the packages that this crate relies on:

Here is the long version of the warnings I got:

The package traitobject v0.1.0` currently triggers the following future incompatibility lints:

warning: conflicting implementations of trait Trait for type (dyn Send + Sync + 'static): (E0119)
--> C:\Users\djv60.cargo\registry\src\index.crates.io-6f17d22bba15001f\traitobject-0.1.0\src\impls.rs:72:1
|
71 | unsafe impl Trait for ::std::marker::Send + Sync { }
| ------------------------------------------------ first implementation here
72 | unsafe impl Trait for ::std::marker::Send + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for (dyn Send + Sync + 'static)
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #56484 rust-lang/rust#56484
= note: #[allow(order_dependent_trait_objects)] on by default

warning: conflicting implementations of trait Trait for type (dyn Send + Sync + 'static): (E0119)
--> C:\Users\djv60.cargo\registry\src\index.crates.io-6f17d22bba15001f\traitobject-0.1.0\src\impls.rs:73:1
|
72 | unsafe impl Trait for ::std::marker::Send + Send + Sync { }
| ------------------------------------------------------- first implementation here
73 | unsafe impl Trait for ::std::marker::Sync + Send { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for (dyn Send + Sync + 'static)
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #56484 rust-lang/rust#56484
= note: #[allow(order_dependent_trait_objects)] on by default

warning: conflicting implementations of trait Trait for type (dyn Send + Sync + 'static): (E0119)
--> C:\Users\djv60.cargo\registry\src\index.crates.io-6f17d22bba15001f\traitobject-0.1.0\src\impls.rs:75:1
|
73 | unsafe impl Trait for ::std::marker::Sync + Send { }
| ------------------------------------------------ first implementation here
74 | unsafe impl Trait for ::std::marker::Sync + Sync { }
75 | unsafe impl Trait for ::std::marker::Sync + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for (dyn Send + Sync + 'static)
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #56484 rust-lang/rust#56484
= note: #[allow(order_dependent_trait_objects)] on by default`

What steps should I take next?

@vi
Copy link
Member

vi commented Oct 18, 2023

Have you tried using tungstenite (or tokio-tungstenite / async-tungstenite) instead of websocket crate? It depends on modern dependencies, unlike websocket.

@DanteVillarreal
Copy link
Author

Have you tried using tungstenite (or tokio-tungstenite / async-tungstenite) instead of websocket crate? It depends on modern dependencies, unlike websocket.

Wow. thanks for the super fast reply. I was expecting a reply in a few weeks, at best.
To answer your question, after I got the warning of impending doom, I tried to use tokio-tungstenite, but I think it'll take me a few days to get the code working. How do people learn a library so fast?

@vi
Copy link
Member

vi commented Oct 18, 2023

How do people learn a library so fast?

What do you mean by "learning a library"? If you can one library (e.g. for WebSockets) then starting using another library for the same thing is likely to be relatively straightforward, unless you need some tricky or low-level details.

In some sense, libraries in general are created to avoid people learning the whole topic (e.g. WebSockets) and instead just learn simpler thing (e.g. Tunhstenite or rust-websocket API or examples).

it'll take me a few days to get the code working

Why the estimate is so high? Why can't websocket implementation provider be swapped in e.g. an hour?

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

No branches or pull requests

2 participants