Auto merge of #1172 - RalfJung:rustup, r=RalfJung

Rustup

and also a test for https://github.com/rust-lang/rust/issues/68303
This commit is contained in:
bors 2020-02-12 21:05:30 +00:00
commit 49aafadfb8
2 changed files with 10 additions and 1 deletions

View file

@ -1 +1 @@
b5e21dbb5cabdaaadc47a4d8e3f59979dcad2871
2d2be570970d784db5539a1d309cd22b85be910a

View file

@ -4,6 +4,7 @@ fn main() {
basic();
ref_protector();
ref_mut_protector();
rust_issue_68303();
}
fn basic() {
@ -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;
}