Skip to content

Commit

Permalink
Adjust note wording
Browse files Browse the repository at this point in the history
  • Loading branch information
jieyouxu committed Mar 8, 2024
1 parent 7852895 commit 27774a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
);

err.note(format!(
"the caller chooses the type of {} which can be different from {}",
"the caller chooses a type for `{}` which can be different from `{}`",
expected_ty_as_param.name, found
));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/return/return-impl-trait-bad.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ LL | "don't suggest this, because the generic param is used in the bound."
|
= note: expected type parameter `T`
found reference `&'static str`
= note: the caller chooses the type of T which can be different from &'static str
= note: the caller chooses a type for `T` which can be different from `&'static str`

error: aborting due to 4 previous errors

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/return/return-impl-trait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LL | ()
|
= note: expected type parameter `T`
found unit type `()`
= note: the caller chooses the type of T which can be different from ()
= note: the caller chooses a type for `T` which can be different from `()`

error[E0308]: mismatched types
--> $DIR/return-impl-trait.rs:23:5
Expand All @@ -29,7 +29,7 @@ LL | ()
|
= note: expected type parameter `T`
found unit type `()`
= note: the caller chooses the type of T which can be different from ()
= note: the caller chooses a type for `T` which can be different from `()`

error: aborting due to 2 previous errors

Expand Down

0 comments on commit 27774a0

Please sign in to comment.