about summary refs log tree commit diff
path: root/tests/crashes/126696.rs
blob: 51dcf6cf29405754a30bf36d4cb68a14f7c0a4a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ known-bug: rust-lang/rust#126696
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]

fn can_double<const N: usize>(x: [(); N])
where
    [(); N * 2]:,
{
    x[0];
    unimplemented!()
}

fn foo<const N: usize>()
where
    [(); (N + 1) * 2]:,
{
    can_double([(); { N + 1 }]);
    // Adding an explicit constant generic causes the ICE to go away
    // can_double::<{N + 1}>([(); { N + 1 }]);
}

fn main() {
    foo::<1>();
}