summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/issue-81899.rs
blob: 9b60612037dd6e76d9792b3e58fe201d8cb592f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Regression test for #81899.
// The `panic!()` below is important to trigger the fixed ICE.

const _CONST: &[u8] = &f(&[], |_| {});
//~^ ERROR any use of this value
//~| WARNING this was previously

const fn f<F>(_: &[u8], _: F) -> &[u8]
where
    F: FnMut(&u8),
{
    panic!() //~ ERROR: evaluation of constant value failed
}

fn main() {}