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

the packages contain code that will become an error in a future release of Rust: "conflicting implementation for (dyn Send + Sync + 'static)" #8

Open
phansel opened this issue Jan 31, 2023 · 2 comments

Comments

@phansel
Copy link

phansel commented Jan 31, 2023

Reporting some issues seen while building an application under stable rust 1.67.0. Haven't seen this one before.

$ cargo report future-incompatibilities --id 2 --package traitobject@0.1.0

The following warnings were discovered during the build. These warnings are an
indication that the packages contain code that will become an error in a
future release of Rust. These warnings typically cover changes to close
soundness problems, unintended or undocumented behavior, or critical problems
that cannot be fixed in a backwards-compatible fashion, and are not expected
to be in wide use.

Each warning should contain a link for more information on what the warning
means and how to resolve it.


To solve this problem, you can try the following approaches:


- If the issue is not solved by updating the dependencies, a fix has to be
implemented by those dependencies. You can help with that by notifying the
maintainers of this problem (e.g. by creating a bug report) or by proposing a
fix to the maintainers (e.g. by creating a pull request):

  - traitobject@0.1.0
  - Repository: https://github.com/reem/rust-traitobject.git
  - Detailed warning command: `cargo report future-incompatibilities --id 2 --package traitobject@0.1.0`

- If waiting for an upstream fix is not an option, you can use the `[patch]`
section in `Cargo.toml` to use your own version of the dependency. For more
information, see:
https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
        
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)
>   --> /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/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 <https://github.com/rust-lang/rust/issues/56484>
>    = note: `#[allow(order_dependent_trait_objects)]` on by default
> 
> warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
>   --> /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/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 <https://github.com/rust-lang/rust/issues/56484>
>    = note: `#[allow(order_dependent_trait_objects)]` on by default
> 
> warning: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)`: (E0119)
>   --> /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/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 <https://github.com/rust-lang/rust/issues/56484>
>    = note: `#[allow(order_dependent_trait_objects)]` on by default
> 
@Harveyhase68
Copy link

Any updates on this?

@velechva
Copy link

Hi @reem I believe you can fix this by replacing the reundant trait impl's with simply:

unsafe impl Trait for ::std::marker::Send { }
unsafe impl Trait for ::std::marker::Sync { }

Could you look into this?

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

3 participants