rust/tests/ui/derived-errors/issue-31997.rs
Lukas Wirth 23d5231607 Use non-2015 edition paths in tests that do not test for their resolution
This allows for testing these tests on editions other than 2015
2025-06-03 10:13:33 +02:00

19 lines
397 B
Rust

// 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<(), ()> {
closure(|| bar(core::ptr::null_mut()))?; //~ ERROR cannot find function `bar` in this scope
Ok(())
}
fn main() { }