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