diff options
| author | Michael Goulet <michael@errs.io> | 2023-09-30 19:29:41 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-10-04 21:09:54 +0000 |
| commit | 137b6d0b01e880b8a8163cd7a14141afc080a9ee (patch) | |
| tree | 51b3d799bd6813874b7c58fcba4103c50b43246b /compiler/rustc_infer/src/errors/mod.rs | |
| parent | eea26141ec2bf07a825011af841463dec51a04c9 (diff) | |
| download | rust-137b6d0b01e880b8a8163cd7a14141afc080a9ee.tar.gz rust-137b6d0b01e880b8a8163cd7a14141afc080a9ee.zip | |
Point to where missing return type should go
Diffstat (limited to 'compiler/rustc_infer/src/errors/mod.rs')
| -rw-r--r-- | compiler/rustc_infer/src/errors/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/errors/mod.rs b/compiler/rustc_infer/src/errors/mod.rs index ad4525c922b..3ff1a5c0c14 100644 --- a/compiler/rustc_infer/src/errors/mod.rs +++ b/compiler/rustc_infer/src/errors/mod.rs @@ -194,13 +194,13 @@ impl<'a> SourceKindMultiSuggestion<'a> { data: &'a FnRetTy<'a>, should_wrap_expr: Option<Span>, ) -> Self { - let (arrow, post) = match data { - FnRetTy::DefaultReturn(_) => ("-> ", " "), - _ => ("", ""), + let arrow = match data { + FnRetTy::DefaultReturn(_) => " -> ", + _ => "", }; let (start_span, start_span_code, end_span) = match should_wrap_expr { - Some(end_span) => (data.span(), format!("{arrow}{ty_info}{post}{{ "), Some(end_span)), - None => (data.span(), format!("{arrow}{ty_info}{post}"), None), + Some(end_span) => (data.span(), format!("{arrow}{ty_info} {{"), Some(end_span)), + None => (data.span(), format!("{arrow}{ty_info}"), None), }; Self::ClosureReturn { start_span, start_span_code, end_span } } |
