Skip to content

Commit

Permalink
Auto merge of #1172 - RalfJung:rustup, r=RalfJung
Browse files Browse the repository at this point in the history
Rustup

and also a test for rust-lang/rust#68303
  • Loading branch information
bors committed Feb 12, 2020
2 parents f9615bf + a843fd4 commit 49aafad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b5e21dbb5cabdaaadc47a4d8e3f59979dcad2871
2d2be570970d784db5539a1d309cd22b85be910a
9 changes: 9 additions & 0 deletions tests/run-pass/stacked-borrows/refcell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fn main() {
basic();
ref_protector();
ref_mut_protector();
rust_issue_68303();
}

fn basic() {
Expand Down Expand Up @@ -66,3 +67,11 @@ fn ref_mut_protector() {
let rc = RefCell::new(0);
break_it(&rc, rc.borrow_mut())
}

/// Make sure we do not have bad enum layout optimizations.
fn rust_issue_68303() {
let optional=Some(RefCell::new(false));
let mut handle=optional.as_ref().unwrap().borrow_mut();
assert!(optional.is_some());
*handle=true;
}

0 comments on commit 49aafad

Please sign in to comment.