Skip to content

Commit 88aa71f

Browse files
committed
add test for assertion failed: !value.has_infer() #115806
Fixes #115806
1 parent b976142 commit 88aa71f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// ICE: assertion failed: !value.has_infer()
2+
// issue: rust-lang/rust#115806
3+
#![feature(associated_const_equality)]
4+
#![allow(incomplete_features)]
5+
6+
pub struct NoPin;
7+
8+
impl<TA> Pins<TA> for NoPin {}
9+
10+
pub trait PinA<PER> {
11+
const A: &'static () = &();
12+
}
13+
14+
pub trait Pins<USART> {}
15+
16+
impl<USART, T> Pins<USART> for T where T: PinA<USART, A = { &() }> {}
17+
//~^ ERROR conflicting implementations of trait `Pins<_>` for type `NoPin`
18+
19+
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0119]: conflicting implementations of trait `Pins<_>` for type `NoPin`
2+
--> $DIR/assoc-const-no-infer-ice-115806.rs:16:1
3+
|
4+
LL | impl<TA> Pins<TA> for NoPin {}
5+
| --------------------------- first implementation here
6+
...
7+
LL | impl<USART, T> Pins<USART> for T where T: PinA<USART, A = { &() }> {}
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `NoPin`
9+
|
10+
= note: downstream crates may implement trait `PinA<_>` for type `NoPin`
11+
12+
error: aborting due to 1 previous error
13+
14+
For more information about this error, try `rustc --explain E0119`.

0 commit comments

Comments
 (0)