]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-fn-in-const-a.rs
Auto merge of #102283 - GuillaumeGomez:option-code-example-unwrap-or-default, r=thomcc
[rust.git] / src / test / ui / borrowck / borrowck-fn-in-const-a.rs
1 // Check that we check fns appearing in constant declarations.
2 // Issue #22382.
3
4 const MOVE: fn(&String) -> String = {
5     fn broken(x: &String) -> String {
6         return *x //~ ERROR cannot move
7     }
8     broken
9 };
10
11 fn main() {
12 }