]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-61452.rs
Rollup merge of #107203 - chenyukang:yukang/fix-106496-remove-deref, r=compiler-errors
[rust.git] / tests / ui / async-await / issue-61452.rs
1 // edition:2018
2
3 pub async fn f(x: Option<usize>) {
4     x.take();
5     //~^ ERROR cannot borrow `x` as mutable, as it is not declared as mutable [E0596]
6 }
7
8 pub async fn g(x: usize) {
9     x += 1;
10     //~^ ERROR cannot assign twice to immutable variable `x` [E0384]
11 }
12
13 fn main() {}