2 // This is largely checking that we now accept code where temp values
3 // are borrowing from the input parameters (the `foo` case below).
5 // Compare to run-pass/issue-23338-params-outlive-temps-of-body.rs
7 // (The `foo2` case is just for parity with the above test, which
8 // shows what happens when you move the `y`-binding to the inside of
11 use std::cell::RefCell;
13 fn foo(x: RefCell<String>) -> String {
17 fn foo2(x: RefCell<String>) -> String {
26 let r = RefCell::new(format!("data"));
27 assert_eq!(foo(r), "data");
28 let r = RefCell::new(format!("data"));
29 assert_eq!(foo2(r), "data");