Open
Description
I tried this code:
// Crate a
#![feature(auto_traits)]
#![feature(negative_impls)]
pub auto trait NotVoid {}
impl !NotVoid for () {}
pub trait A<I, O> {}
impl<T, I: NotVoid> A<I, ()> for T {}
impl<T, O: NotVoid> A<(), O> for T {} // OK
use b::ExternNotVoid;
pub trait B<I, O> {}
impl<T, I: ExternNotVoid> B<I, ()> for T {}
impl<T, O: ExternNotVoid> B<(), O> for T {} // Error
// Crate b
#![feature(auto_traits)]
#![feature(negative_impls)]
pub auto trait ExternNotVoid {}
impl !ExternNotVoid for () {}
I expected to see this happen:
Identical behavior when NotVoid
is declared in an external crate.
Instead, this happened:
error[E0119]: conflicting implementations of trait `B<(), ()>`
--> a.rs:19:1
|
18 | impl<T, I: ExternNotVoid> B<I, ()> for T {} // Error
| ---------------------------------------- first implementation here
19 | impl<T, O: ExternNotVoid> B<(), O> for T {} // Error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
error: aborting due to previous error
For more information about this error, try `rustc --explain E0119`.
An error is produced when NotVoid
is declared in an external crate (ExternNotVoid
).
Meta
rustc --version --verbose
:
rustc 1.70.0-nightly (e3dfeeaa4 2023-03-07)
binary: rustc
commit-hash: e3dfeeaa45f117281b19773d67f3f253de65cee1
commit-date: 2023-03-07
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7