about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKevin Per <kevin.per@protonmail.com>2020-05-03 13:56:46 +0200
committerKevin Per <kevin.per@protonmail.com>2020-05-03 13:56:46 +0200
commitd232be80f82b052fd023eb2f4904ccad0aa42d7a (patch)
treebec8804136d049a7c6eb202b689dfaf8f5e5c0f6
parentbc29f1d062feeb68207c961d254652d6bff9fd9b (diff)
downloadrust-d232be80f82b052fd023eb2f4904ccad0aa42d7a.tar.gz
rust-d232be80f82b052fd023eb2f4904ccad0aa42d7a.zip
Fix tidy checks
-rw-r--r--src/librustc_trait_selection/traits/error_reporting/suggestions.rs41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs
index 37f567401b7..c90769c6655 100644
--- a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs
+++ b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs
@@ -570,33 +570,30 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                     // original type obligation, not the last one that failed, which is arbitrary.
                     // Because of this, we modify the error to refer to the original obligation and
                     // return early in the caller.
-                    
 
                     let has_colon = self
-                            .tcx
-                            .sess
-                            .source_map()
-                            .span_to_snippet(span)
-                            .map(|w| w.contains(":"))
-                            .unwrap_or(false);
+                        .tcx
+                        .sess
+                        .source_map()
+                        .span_to_snippet(span)
+                        .map(|w| w.contains(":"))
+                        .unwrap_or(false);
 
                     let has_double_colon = self
-                            .tcx
-                            .sess
-                            .source_map()
-                            .span_to_snippet(span)
-                            .map(|w| w.contains("::"))
-                            .unwrap_or(false);
+                        .tcx
+                        .sess
+                        .source_map()
+                        .span_to_snippet(span)
+                        .map(|w| w.contains("::"))
+                        .unwrap_or(false);
 
                     let has_bracket = self
-                            .tcx
-                            .sess
-                            .source_map()
-                            .span_to_snippet(span)
-                            .map(|w| w.contains("{"))
-                            .unwrap_or(false);
-
-                   
+                        .tcx
+                        .sess
+                        .source_map()
+                        .span_to_snippet(span)
+                        .map(|w| w.contains("{"))
+                        .unwrap_or(false);
 
                     let msg = format!(
                         "the trait bound `{}: {}` is not satisfied",
@@ -620,7 +617,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                             obligation.parent_trait_ref.skip_binder().print_only_trait_path(),
                         ),
                     );
-                
+
                     // This if is to prevent a special edge-case
                     if !has_colon || has_double_colon || has_bracket {
                         // We don't want a borrowing suggestion on the fields in structs,