rust/tests/ui/lifetimes/lifetime-errors/issue_74400.rs

17 lines
399 B
Rust
Raw Normal View History

2021-08-31 04:03:49 -05:00
//! Regression test for #74400: Type mismatch in function arguments E0631, E0271 are falsely
//! recognized as E0308 mismatched types.
use std::convert::identity;
fn main() {}
fn f<T, S>(data: &[T], key: impl Fn(&T) -> S) {
}
fn g<T>(data: &[T]) {
2022-05-22 01:05:15 -05:00
f(data, identity)
2022-04-01 12:13:25 -05:00
//~^ ERROR the parameter type
//~| ERROR mismatched types
//~| ERROR implementation of `FnOnce` is not general
2021-08-31 04:03:49 -05:00
}