1 // This is a regression test for a problem encountered around upvar
2 // inference and trait caching: in particular, we were entering a
3 // temporary closure kind during inference, and then caching results
4 // based on that temporary kind, which led to no error being reported
5 // in this particular test.
11 fn apply<F>(f: F) where F: Fn() {
15 let mut farewell = "goodbye".to_owned();
16 let diary = || { //~ ERROR E0525
17 farewell.push_str("!!!");
18 println!("Then I screamed {}.", farewell);