2024-06-16 12:57:01 -05:00
|
|
|
// Checks existence or absence of a note for "a caller chooses ty for ty param" upon return ty
|
|
|
|
// mismatch.
|
2024-03-09 14:32:36 -06:00
|
|
|
|
|
|
|
fn f<T>() -> (T,) {
|
|
|
|
(0,) //~ ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
|
|
|
fn g<U, V>() -> (U, V) {
|
|
|
|
(0, "foo")
|
|
|
|
//~^ ERROR mismatched types
|
|
|
|
//~| ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
|
|
|
fn h() -> u8 {
|
|
|
|
0u8
|
|
|
|
}
|
|
|
|
|
2024-06-16 12:57:01 -05:00
|
|
|
// This case was reported in <https://github.com/rust-lang/rust/issues/126547> where it doesn't
|
|
|
|
// make sense to make the "note caller chooses ty for ty param" note if the found type contains
|
|
|
|
// the ty param...
|
|
|
|
fn k<T>(_t: &T) -> T {
|
|
|
|
_t
|
|
|
|
//~^ ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
2024-03-09 14:32:36 -06:00
|
|
|
fn main() {
|
|
|
|
f::<()>();
|
|
|
|
g::<(), ()>;
|
|
|
|
let _ = h();
|
|
|
|
}
|