diff --git a/tests/ui/generic-const-items/assoc-const-AnonConst-ice-108220.rs b/tests/ui/generic-const-items/assoc-const-AnonConst-ice-108220.rs new file mode 100644 index 00000000000..f5babb67b56 --- /dev/null +++ b/tests/ui/generic-const-items/assoc-const-AnonConst-ice-108220.rs @@ -0,0 +1,35 @@ +// ICE assertion failed: matches!(self.def_kind(ct.def.did), DefKind :: AnonConst) +// issue: rust-lang/rust#108220 +//@ check-pass + +#![feature(associated_const_equality)] +#![allow(unused)] + +use std::marker::PhantomData; + +pub struct NoPin; + +pub trait SetAlternate {} + +impl SetAlternate<0> for NoPin {} + +pub trait PinA { + const A: u8; +} + +impl PinA for NoPin { + const A: u8 = 0; +} + +pub trait Pins {} + +impl Pins for T where + T: PinA + SetAlternate +{ +} + +struct Serial(PhantomData); + +impl Serial where NoPin: Pins {} + +fn main() {}