1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Regression test for #42602. It used to be that we had
14 // typeck(foo) -> FnOnce -> typeck(bar)
16 // This was fixed by improving the resolution of the `FnOnce` trait
20 // compile-flags:-Zquery-dep-graph
22 #![feature(rustc_attrs)]
30 #[rustc_if_this_changed(HirBody)]
32 let x = vec![1, 2, 3];
33 let v = || ::std::mem::drop(x);
39 #[rustc_then_this_would_need(TypeckTables)] //[cfail1]~ ERROR no path
41 let x = vec![1, 2, 3];
42 let v = || ::std::mem::drop(x);