diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-09-29 03:28:52 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-09-29 03:28:52 +0000 |
| commit | eceb48534a4fdabfaf378ea02a2c5cd43b8c52a5 (patch) | |
| tree | 0e6271782f35884bc9869cf32e6275f4e6f9a83d /compiler | |
| parent | 8d72d3e1e96f58ca10059a6bb6e8aecba4a0e9cd (diff) | |
| download | rust-eceb48534a4fdabfaf378ea02a2c5cd43b8c52a5.tar.gz rust-eceb48534a4fdabfaf378ea02a2c5cd43b8c52a5.zip | |
Make replacement suggestion `_` in type verbose
```
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/in-signature.rs:6:21
|
LL | fn arr_fn() -> [u8; _] {
| ^ not allowed in type signatures
|
help: replace with the correct return type
|
LL - fn arr_fn() -> [u8; _] {
LL + fn arr_fn() -> [u8; 3] {
|
```
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index b72e743f95b..02baaec3713 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -1140,7 +1140,7 @@ fn recover_infer_ret_ty<'tcx>( // recursive function definition to leak out into the fn sig. let mut recovered_ret_ty = None; if let Some(suggestable_ret_ty) = ret_ty.make_suggestable(tcx, false, None) { - diag.span_suggestion( + diag.span_suggestion_verbose( infer_ret_ty.span, "replace with the correct return type", suggestable_ret_ty, @@ -1152,7 +1152,7 @@ fn recover_infer_ret_ty<'tcx>( tcx.param_env(def_id), ret_ty, ) { - diag.span_suggestion( + diag.span_suggestion_verbose( infer_ret_ty.span, "replace with an appropriate return type", sugg, |
