Skip to content

Commit

Permalink
add test for assertion failed: !value.has_infer() rust-lang#115806
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Apr 6, 2024
1 parent b976142 commit 88aa71f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/ui/generic-const-items/assoc-const-no-infer-ice-115806.rs
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 88aa71f

Please sign in to comment.