add test for assertion failed: !value.has_infer() #115806

Fixes https://github.com/rust-lang/rust/issues/115806
This commit is contained in:
Matthias Krüger 2024-04-07 01:45:31 +02:00
parent b976142439
commit 88aa71f108
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// ICE: assertion failed: !value.has_infer()
// issue: rust-lang/rust#115806
#![feature(associated_const_equality)]
#![allow(incomplete_features)]
pub struct NoPin;
impl<TA> Pins<TA> for NoPin {}
pub trait PinA<PER> {
const A: &'static () = &();
}
pub trait Pins<USART> {}
impl<USART, T> Pins<USART> for T where T: PinA<USART, A = { &() }> {}
//~^ ERROR conflicting implementations of trait `Pins<_>` for type `NoPin`
pub fn main() {}

View File

@ -0,0 +1,14 @@
error[E0119]: conflicting implementations of trait `Pins<_>` for type `NoPin`
--> $DIR/assoc-const-no-infer-ice-115806.rs:16:1
|
LL | impl<TA> Pins<TA> for NoPin {}
| --------------------------- first implementation here
...
LL | impl<USART, T> Pins<USART> for T where T: PinA<USART, A = { &() }> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `NoPin`
|
= note: downstream crates may implement trait `PinA<_>` for type `NoPin`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0119`.