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.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/hir-ty/src/layout/tests/closure.rs b/crates/hir-ty/src/layout/tests/closure.rs
index 31b6765a7a..0db4edeb69 100644
--- a/crates/hir-ty/src/layout/tests/closure.rs
+++ b/crates/hir-ty/src/layout/tests/closure.rs
@@ -41,6 +41,15 @@ fn ref_simple() {
}
}
size_and_align_expr! {
+ minicore: copy, deref_mut;
+ stmts: [
+ let y: &mut i32 = &mut 5;
+ ]
+ |x: i32| {
+ *y += x;
+ }
+ }
+ size_and_align_expr! {
minicore: copy;
stmts: [
struct X(i32, i64);
@@ -50,6 +59,16 @@ fn ref_simple() {
x
}
}
+ size_and_align_expr! {
+ minicore: copy, deref_mut;
+ stmts: [
+ struct X(i32, i64);
+ let x: &mut X = &mut X(2, 6);
+ ]
+ || {
+ (*x).0 as i64 + x.1
+ }
+ }
}
#[test]