]> git.lizzy.rs Git - rust.git/blob - src/test/ui/derived-errors/issue-31997.rs
025e9100e23601c384ecdcec54c152fd43941da5
[rust.git] / src / test / ui / derived-errors / issue-31997.rs
1 // Test that the resolve failure does not lead to downstream type errors.
2 // See issue #31997.
3
4 trait TheTrait { }
5
6 fn closure<F, T>(x: F) -> Result<T, ()>
7     where F: FnMut() -> T, T: TheTrait,
8 {
9     unimplemented!()
10 }
11
12 fn foo() -> Result<(), ()> {
13     try!(closure(|| bar(0 as *mut _))); //~ ERROR cannot find function `bar` in this scope
14     Ok(())
15 }
16
17 fn main() { }