]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-81899.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-81899.rs
1 // Regression test for #81899.
2 // The `panic!()` below is important to trigger the fixed ICE.
3
4 const _CONST: &[u8] = &f(&[], |_| {});
5 //~^ constant
6
7 const fn f<F>(_: &[u8], _: F) -> &[u8]
8 where
9     F: FnMut(&u8),
10 {
11     panic!() //~ ERROR evaluation of constant value failed
12     //~^ panic
13 }
14
15 fn main() {}