mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 05:04:24 +00:00
15 lines
303 B
Rust
15 lines
303 B
Rust
|
// 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() {
|
||
|
}
|