diff options
Diffstat (limited to 'tests/ui/async-await/issue-75785-confusing-named-region.rs')
-rw-r--r-- | tests/ui/async-await/issue-75785-confusing-named-region.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/async-await/issue-75785-confusing-named-region.rs b/tests/ui/async-await/issue-75785-confusing-named-region.rs new file mode 100644 index 000000000..452614087 --- /dev/null +++ b/tests/ui/async-await/issue-75785-confusing-named-region.rs @@ -0,0 +1,13 @@ +// edition:2018 +// +// Regression test for issue #75785 +// Tests that we don't point to a confusing named +// region when emitting a diagnostic + +pub async fn async_fn(x: &mut i32) -> (&i32, &i32) { + let y = &*x; + *x += 1; //~ ERROR cannot assign to + (&32, y) +} + +fn main() {} |