rust/tests/ui/async-await/issue-61452.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
280 B
Rust
Raw Normal View History

2019-06-07 12:35:06 -05:00
//@ edition:2018
pub async fn f(x: Option<usize>) {
x.take();
//~^ ERROR cannot borrow `x` as mutable, as it is not declared as mutable [E0596]
}
pub async fn g(x: usize) {
x += 1;
//~^ ERROR cannot assign twice to immutable variable `x` [E0384]
}
fn main() {}