summaryrefslogtreecommitdiffstats
path: root/src/test/ui/derived-errors/issue-31997.rs
blob: ff619313afb5be53f227836ef027f2254adb8dda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test that the resolve failure does not lead to downstream type errors.
// See issue #31997.
#![allow(deprecated)]

trait TheTrait { }

fn closure<F, T>(x: F) -> Result<T, ()>
    where F: FnMut() -> T, T: TheTrait,
{
    unimplemented!()
}

fn foo() -> Result<(), ()> {
    try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope
    Ok(())
}

fn main() { }