diff options
Diffstat (limited to 'tests/ui/borrowck/borrowck-fn-in-const-a.rs')
-rw-r--r-- | tests/ui/borrowck/borrowck-fn-in-const-a.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-fn-in-const-a.rs b/tests/ui/borrowck/borrowck-fn-in-const-a.rs new file mode 100644 index 000000000..d4ceae296 --- /dev/null +++ b/tests/ui/borrowck/borrowck-fn-in-const-a.rs @@ -0,0 +1,12 @@ +// Check that we check fns appearing in constant declarations. +// Issue #22382. + +const MOVE: fn(&String) -> String = { + fn broken(x: &String) -> String { + return *x //~ ERROR cannot move + } + broken +}; + +fn main() { +} |