diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-25 17:05:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-25 17:05:34 +0100 |
| commit | 877f29363daffe7734bcfb9efbc32b9a06251465 (patch) | |
| tree | a85f7fad39ad46ae31a4dfee1682d0f8d4b899bb /tests/ui/generic-const-items | |
| parent | 9b4ee1be9e7317ef3f698423e584188518fcdc5c (diff) | |
| parent | e4d816e66c9de3e78a330cd27287c10b831b1c14 (diff) | |
| download | rust-877f29363daffe7734bcfb9efbc32b9a06251465.tar.gz rust-877f29363daffe7734bcfb9efbc32b9a06251465.zip | |
Rollup merge of #122988 - matthiaskrgr:icetests, r=petrochenkov
add even more tests! Fixes https://github.com/rust-lang/rust/issues/109869 Fixes https://github.com/rust-lang/rust/issues/110453 Fixes https://github.com/rust-lang/rust/issues/109020 Fixes https://github.com/rust-lang/rust/issues/108580 Fixes https://github.com/rust-lang/rust/issues/108220 Fixes https://github.com/rust-lang/rust/issues/113045 Fixes https://github.com/rust-lang/rust/issues/113133 Fixes https://github.com/rust-lang/rust/issues/114464 Fixes https://github.com/rust-lang/rust/issues/116599 Fixes https://github.com/rust-lang/rust/issues/119731
Diffstat (limited to 'tests/ui/generic-const-items')
| -rw-r--r-- | tests/ui/generic-const-items/assoc-const-AnonConst-ice-108220.rs | 35 |
1 files changed, 35 insertions, 0 deletions
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<const A: u8> {} + +impl SetAlternate<0> for NoPin {} + +pub trait PinA<PER> { + const A: u8; +} + +impl<PER> PinA<PER> for NoPin { + const A: u8 = 0; +} + +pub trait Pins<USART> {} + +impl<USART, T, const TA: u8> Pins<USART> for T where + T: PinA<USART, A = { TA }> + SetAlternate<TA> +{ +} + +struct Serial<USART>(PhantomData<USART>); + +impl<USART> Serial<USART> where NoPin: Pins<USART> {} + +fn main() {} |
