]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/borrowck-fn-in-const-b.rs
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / borrowck-fn-in-const-b.rs
1 // Check that we check fns appearing in constant declarations.
2 // Issue #22382.
3
4 // How about mutating an immutable vector?
5 const MUTATE: fn(&Vec<String>) = {
6     fn broken(x: &Vec<String>) {
7         x.push(format!("this is broken"));
8         //~^ ERROR cannot borrow
9     }
10     broken
11 };
12
13 fn main() {
14 }