rust/tests/ui/derived-errors/issue-31997.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
402 B
Rust
Raw Normal View History

// Test that the resolve failure does not lead to downstream type errors.
// See issue #31997.
#![allow(deprecated)]
2016-03-10 10:21:00 +00:00
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() { }