We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f9615bf + a843fd4 commit 49aafadCopy full SHA for 49aafad
rust-version
@@ -1 +1 @@
1
-b5e21dbb5cabdaaadc47a4d8e3f59979dcad2871
+2d2be570970d784db5539a1d309cd22b85be910a
tests/run-pass/stacked-borrows/refcell.rs
@@ -4,6 +4,7 @@ fn main() {
4
basic();
5
ref_protector();
6
ref_mut_protector();
7
+ rust_issue_68303();
8
}
9
10
fn basic() {
@@ -66,3 +67,11 @@ fn ref_mut_protector() {
66
67
let rc = RefCell::new(0);
68
break_it(&rc, rc.borrow_mut())
69
70
+
71
+/// Make sure we do not have bad enum layout optimizations.
72
+fn rust_issue_68303() {
73
+ let optional=Some(RefCell::new(false));
74
+ let mut handle=optional.as_ref().unwrap().borrow_mut();
75
+ assert!(optional.is_some());
76
+ *handle=true;
77
+}
0 commit comments