Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/layout/tests/closure.rs')
| -rw-r--r-- | crates/hir-ty/src/layout/tests/closure.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/hir-ty/src/layout/tests/closure.rs b/crates/hir-ty/src/layout/tests/closure.rs index 0db4edeb69..a2e19852a0 100644 --- a/crates/hir-ty/src/layout/tests/closure.rs +++ b/crates/hir-ty/src/layout/tests/closure.rs @@ -106,6 +106,20 @@ fn nested_closures() { } #[test] +fn capture_specific_fields2() { + size_and_align_expr! { + minicore: copy; + stmts: [ + let x = &mut 2; + ] + || { + *x = 5; + &x; + } + } +} + +#[test] fn capture_specific_fields() { size_and_align_expr! { struct X(i64, i32, (u8, i128)); |