2016-03-15 03:49:10 -05:00
|
|
|
// Test that the resolve failure does not lead to downstream type errors.
|
|
|
|
// See issue #31997.
|
2019-07-14 03:16:46 -05:00
|
|
|
#![allow(deprecated)]
|
2016-03-10 04:21:00 -06:00
|
|
|
|
2016-03-15 03:49:10 -05:00
|
|
|
trait TheTrait { }
|
2016-03-09 15:53:19 -06:00
|
|
|
|
2016-03-15 03:49:10 -05:00
|
|
|
fn closure<F, T>(x: F) -> Result<T, ()>
|
|
|
|
where F: FnMut() -> T, T: TheTrait,
|
2016-03-09 15:53:19 -06:00
|
|
|
{
|
2016-03-15 03:49:10 -05:00
|
|
|
unimplemented!()
|
2016-03-09 15:53:19 -06:00
|
|
|
}
|
|
|
|
|
2016-03-15 03:49:10 -05:00
|
|
|
fn foo() -> Result<(), ()> {
|
2019-07-14 03:16:46 -05:00
|
|
|
try!(closure(|| bar(core::ptr::null_mut()))); //~ ERROR cannot find function `bar` in this scope
|
2016-03-15 03:49:10 -05:00
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|