3 #![allow(unused_variables)]
4 // Test that we choose Deref or DerefMut appropriately based on mutability of ref bindings (#15609).
7 use std::cell::RefCell;
19 let x = RefCell::new(S { node: E::Foo(0) });
21 let mut b = x.borrow_mut();
23 E::Foo(ref mut n) => *n += 1,
28 let x = RefCell::new(0);
29 let mut y = x.borrow_mut();
32 fn foo(a: &mut RefCell<Option<String>>) {
33 if let Some(ref mut s) = *a.borrow_mut() {