Closed
Description
Code:
#![feature(async_await)]
async fn foo(n: u32, mut vec: Vec<u32>) {
vec.push(n);
}
Error:
error[E0596]: cannot borrow `vec` as mutable, as it is not declared as mutable
--> code\src\lib.rs:4:5
|
3 | async fn foo(n: u32, mut vec: Vec<u32>) {
| ------- help: consider changing this to be mutable: `mut vec`
4 | vec.push(n);
| ^^^ cannot borrow as mutable
Rustc version: rustc 1.36.0-nightly (08bfe16 2019-05-02)