Skip to content

Commit 1c37a23

Browse files
authored
Rollup merge of rust-lang#122195 - jieyouxu:impl-return-note, r=fmease
Note that the caller chooses a type for type param ``` error[E0308]: mismatched types --> $DIR/return-impl-trait.rs:23:5 | LL | fn other_bounds<T>() -> T | - - | | | | | expected `T` because of return type | | help: consider using an impl return type: `impl Trait` | expected this type parameter ... LL | () | ^^ expected type parameter `T`, found `()` | = note: expected type parameter `T` found unit type `()` = note: the caller chooses the type of T which can be different from () ``` Tried to see if "expected this type parameter" can be replaced, but that goes all the way to `rustc_infer` so seems not worth the effort and can affect other diagnostics. Revives rust-lang#112088 and rust-lang#104755.
2 parents 879899c + f9a9c4b commit 1c37a23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/ui/builtin_type_shadow.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ LL | 42
1919
|
2020
= note: expected type parameter `u32`
2121
found type `{integer}`
22+
= note: the caller chooses a type for `u32` which can be different from `i32`
2223

2324
error: aborting due to 2 previous errors
2425

0 commit comments

Comments
 (0)