Skip to content

Commit fedb021

Browse files
committed
Add a regression test for an ICE when using impl Trait with a const generic bound
1 parent 6dd94d6 commit fedb021

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//! Regression test for https://github.com/rust-lang/rust/issues/118278
2+
3+
//@ check-pass
4+
5+
#![allow(incomplete_features)]
6+
#![feature(generic_const_exprs)]
7+
8+
pub trait Foo {
9+
const SIZE: usize;
10+
}
11+
12+
impl Foo for u64 {
13+
const SIZE: usize = 8;
14+
}
15+
16+
pub struct Wrapper<T>
17+
where
18+
T: Foo,
19+
[(); T::SIZE]:,
20+
{
21+
pub t: T,
22+
}
23+
24+
pub fn bar() -> Wrapper<impl Foo> {
25+
Wrapper { t: 10 }
26+
}
27+
28+
fn main() {}

0 commit comments

Comments
 (0)