]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-fn-in-const-a.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / 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 }