rust/tests/ui/return/return-ty-mismatch-note.stderr
2024-06-18 21:06:53 +00:00

50 lines
1.4 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/return-ty-mismatch-note.rs:5:6
|
LL | fn f<T>() -> (T,) {
| - expected this type parameter
LL | (0,)
| ^ expected type parameter `T`, found integer
|
= note: expected type parameter `T`
found type `{integer}`
error[E0308]: mismatched types
--> $DIR/return-ty-mismatch-note.rs:9:6
|
LL | fn g<U, V>() -> (U, V) {
| - expected this type parameter
LL | (0, "foo")
| ^ expected type parameter `U`, found integer
|
= note: expected type parameter `U`
found type `{integer}`
error[E0308]: mismatched types
--> $DIR/return-ty-mismatch-note.rs:9:9
|
LL | fn g<U, V>() -> (U, V) {
| - expected this type parameter
LL | (0, "foo")
| ^^^^^ expected type parameter `V`, found `&str`
|
= note: expected type parameter `V`
found reference `&'static str`
error[E0308]: mismatched types
--> $DIR/return-ty-mismatch-note.rs:22:5
|
LL | fn k<T>(_t: &T) -> T {
| - - expected `T` because of return type
| |
| expected this type parameter
LL | _t
| ^^ expected type parameter `T`, found `&T`
|
= note: expected type parameter `_`
found reference `&_`
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.