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