summary refs log tree commit diff
path: root/tests/ui/borrowck/refcell-borrow-comparison-12033.rs
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-24 17:22:54 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-31 21:25:49 +0500
commita4a5bf5a71bd0c3fb52a28f81d88ce1755b3bc30 (patch)
treeb69177434a4026599cbd602cc2aee39759f89cdd /tests/ui/borrowck/refcell-borrow-comparison-12033.rs
parentd636a6590ce1429ff011e04bb0b4d393dc382226 (diff)
downloadrust-a4a5bf5a71bd0c3fb52a28f81d88ce1755b3bc30.tar.gz
rust-a4a5bf5a71bd0c3fb52a28f81d88ce1755b3bc30.zip
comments
Diffstat (limited to 'tests/ui/borrowck/refcell-borrow-comparison-12033.rs')
-rw-r--r--tests/ui/borrowck/refcell-borrow-comparison-12033.rs9
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 {}
+}