Skip to content

Commit 49aafad

Browse files
committed
Auto merge of #1172 - RalfJung:rustup, r=RalfJung
Rustup and also a test for rust-lang/rust#68303
2 parents f9615bf + a843fd4 commit 49aafad

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b5e21dbb5cabdaaadc47a4d8e3f59979dcad2871
1+
2d2be570970d784db5539a1d309cd22b85be910a

tests/run-pass/stacked-borrows/refcell.rs

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
basic();
55
ref_protector();
66
ref_mut_protector();
7+
rust_issue_68303();
78
}
89

910
fn basic() {
@@ -66,3 +67,11 @@ fn ref_mut_protector() {
6667
let rc = RefCell::new(0);
6768
break_it(&rc, rc.borrow_mut())
6869
}
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

Comments
 (0)