Skip to content

Rustup #1172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Rustup #1172

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}