From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../diagnostics/cant-mutate-imm.rs | 34 ---------------------- 1 file changed, 34 deletions(-) delete mode 100644 src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs (limited to 'src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs') diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs deleted file mode 100644 index 25ee9a149..000000000 --- a/src/test/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.rs +++ /dev/null @@ -1,34 +0,0 @@ -// edition:2021 - -// Ensure that diagnostics for mutability error (because the root variable -// isn't mutable) work with `capture_disjoint_fields` enabled. - -fn mut_error_struct() { - let x = (10, 10); - let y = (x, 10); - let z = (y, 10); - - let mut c = || { - z.0.0.0 = 20; - //~^ ERROR: cannot assign to `z.0.0.0`, as it is not declared as mutable - }; - - c(); -} - -fn mut_error_box() { - let x = (10, 10); - let bx = Box::new(x); - - let mut c = || { - bx.0 = 20; - //~^ ERROR: cannot assign to `*bx.0`, as it is not declared as mutable - }; - - c(); -} - -fn main() { - mut_error_struct(); - mut_error_box(); -} -- cgit v1.2.3