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