diff options
Diffstat (limited to 'tests/ui/async-await/issue-61452.rs')
-rw-r--r-- | tests/ui/async-await/issue-61452.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/async-await/issue-61452.rs b/tests/ui/async-await/issue-61452.rs new file mode 100644 index 000000000..9381251ad --- /dev/null +++ b/tests/ui/async-await/issue-61452.rs @@ -0,0 +1,13 @@ +// 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() {} |