]> git.lizzy.rs Git - rust.git/blob - tests/ui/derived-errors/issue-31997.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / derived-errors / issue-31997.rs
1 // Test that the resolve failure does not lead to downstream type errors.
2 // See issue #31997.
3 #![allow(deprecated)]
4
5 trait TheTrait { }
6
7 fn closure<F, T>(x: F) -> Result<T, ()>
8     where F: FnMut() -> T, T: TheTrait,
9 {
10     unimplemented!()
11 }
12
13 fn foo() -> Result<(), ()> {
14     try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope
15     Ok(())
16 }
17
18 fn main() { }