We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87644d1 commit b7f109cCopy full SHA for b7f109c
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
+ optional.is_some();
76
+ *handle=true;
77
+}
0 commit comments