summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_infer/src/errors
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_infer/src/errors')
-rw-r--r--compiler/rustc_infer/src/errors/mod.rs10
-rw-r--r--compiler/rustc_infer/src/errors/note_and_explain.rs4
2 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_infer/src/errors/mod.rs b/compiler/rustc_infer/src/errors/mod.rs
index ad4525c92..3ff1a5c0c 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 }
}
diff --git a/compiler/rustc_infer/src/errors/note_and_explain.rs b/compiler/rustc_infer/src/errors/note_and_explain.rs
index 9276bb0a7..57bc14ebc 100644
--- a/compiler/rustc_infer/src/errors/note_and_explain.rs
+++ b/compiler/rustc_infer/src/errors/note_and_explain.rs
@@ -60,9 +60,7 @@ impl<'a> DescriptionCtx<'a> {
let span = Some(tcx.def_span(scope));
(span, "defined_here", String::new())
}
- _ => {
- (Some(tcx.def_span(scope)), "defined_here_reg", region.to_string())
- }
+ _ => (Some(tcx.def_span(scope)), "defined_here_reg", region.to_string()),
}
}
}