summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/borrowck-fn-in-const-b.rs
blob: 822083efee06843d3580486db0ec1450e03fe0ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Check that we check fns appearing in constant declarations.
// Issue #22382.

// How about mutating an immutable vector?
const MUTATE: fn(&Vec<String>) = {
    fn broken(x: &Vec<String>) {
        x.push(format!("this is broken"));
        //~^ ERROR cannot borrow
    }
    broken
};

fn main() {
}