diff options
Diffstat (limited to 'tests/ui/borrowck/refcell-borrow-comparison-12033.rs')
| -rw-r--r-- | tests/ui/borrowck/refcell-borrow-comparison-12033.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/borrowck/refcell-borrow-comparison-12033.rs b/tests/ui/borrowck/refcell-borrow-comparison-12033.rs new file mode 100644 index 00000000000..de22cedd5b9 --- /dev/null +++ b/tests/ui/borrowck/refcell-borrow-comparison-12033.rs @@ -0,0 +1,9 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/12033 + +//@ run-pass +use std::cell::RefCell; + +fn main() { + let x = RefCell::new(0); + if *x.borrow() == 0 {} else {} +} |
