]> git.lizzy.rs Git - rust.git/commitdiff
Fix style according to review comments.
authorVitaly _Vi Shukela <vi0oss@gmail.com>
Sun, 16 Sep 2018 23:40:44 +0000 (02:40 +0300)
committerVitaly _Vi Shukela <vi0oss@gmail.com>
Sun, 16 Sep 2018 23:49:27 +0000 (02:49 +0300)
src/librustc/session/mod.rs
src/librustc_borrowck/borrowck/mod.rs
src/librustc_errors/diagnostic.rs
src/librustc_errors/diagnostic_builder.rs
src/librustc_passes/loops.rs
src/librustc_resolve/lib.rs

index 013cba5a332d1051f8ecdcda739464211570df59..0821e9c4b44b0e1cd44ee7c6d2980162d2882c02 100644 (file)
@@ -432,8 +432,12 @@ fn diag_once<'a, 'b>(
                 }
                 DiagnosticBuilderMethod::SpanSuggestion(suggestion) => {
                     let span = span_maybe.expect("span_suggestion_* needs a span");
-                    diag_builder.span_suggestion_with_applicability(span, message, suggestion,
-                                                                    Applicability::Unspecified);
+                    diag_builder.span_suggestion_with_applicability(
+                                                                    span,
+                                                                    message,
+                                                                    suggestion,
+                                                                    Applicability::Unspecified,
+                                                                    );
                 }
             }
         }
index be7311b684191109fa48bc923f190928c96cd600..658a67b57670c0c03199a6cdea17bccc2d1b94be 100644 (file)
@@ -868,11 +868,19 @@ fn report_bckerr(&self, err: &BckError<'a, 'tcx>) {
                                             db.note(fn_closure_msg);
                                         } else {
                                             db.span_suggestion_with_applicability(
-                                                sp, msg, suggestion, Applicability::Unspecified);
+                                                                                  sp,
+                                                                                  msg,
+                                                                                  suggestion,
+                                                                                  Applicability::Unspecified,
+                                                                                  );
                                         }
                                     } else {
                                         db.span_suggestion_with_applicability(
-                                                sp, msg, suggestion, Applicability::Unspecified);
+                                                                              sp,
+                                                                              msg,
+                                                                              suggestion,
+                                                                              Applicability::Unspecified,
+                                                                              );
                                     }
                                 }
                                 _ => {
@@ -1330,13 +1338,14 @@ fn report_out_of_scope_escaping_closure_capture(&self,
                                                   &cmt_path_or_string,
                                                   capture_span,
                                                   Origin::Ast)
-            .span_suggestion_with_applicability(err.span,
-                             &format!("to force the closure to take ownership of {} \
-                                       (and any other referenced variables), \
-                                       use the `move` keyword",
-                                       cmt_path_or_string),
-                             suggestion,
-                             Applicability::Unspecified,
+            .span_suggestion_with_applicability(
+                                         err.span,
+                                         &format!("to force the closure to take ownership of {} \
+                                                   (and any other referenced variables), \
+                                                   use the `move` keyword",
+                                                   cmt_path_or_string),
+                                         suggestion,
+                                         Applicability::Unspecified,
             )
             .emit();
         self.signal_error();
index b7d81efe9623d2eba6e722a6c812a80a1293b39f..f7e5e25c8370d5ac50281f88b16532a9f1948eab 100644 (file)
@@ -307,10 +307,10 @@ pub fn multipart_suggestion(
         suggestion: Vec<(Span, String)>,
     ) -> &mut Self {
         self.multipart_suggestion_with_applicability(
-                                                     msg,
-                                                     suggestion,
-                                                     Applicability::Unspecified
-                                                    )
+                                                 msg,
+                                                 suggestion,
+                                                 Applicability::Unspecified,
+        )
     }
 
     /// Prints out a message with multiple suggested edits of the code.
index 4287b37ac540454aabcfb126d4141a83709630c1..d1b6865e59b5da0a86b1e8484c60ae4ae814bff8 100644 (file)
@@ -172,9 +172,10 @@ pub fn span_label<T: Into<String>>(&mut self, span: Span, label: T) -> &mut Self
                                                   -> &mut Self);
 
     #[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
-    forward!(pub fn span_suggestion_short(&mut self,
-                                          sp: Span,
-                                          msg: &str,
+    forward!(pub fn span_suggestion_short(
+                                      &mut self,
+                                      sp: Span,
+                                      msg: &str,
                                           suggestion: String)
                                           -> &mut Self);
 
index 5cbdae60c26e59d159702c332cca155e996269e5..cf8967ab28321915f62a831ce1a3df305b523ff7 100644 (file)
@@ -141,7 +141,8 @@ fn visit_expr(&mut self, e: &'hir hir::Expr) {
                                 .span_label(e.span,
                                             "can only break with a value inside \
                                             `loop` or breakable block")
-                                .span_suggestion_with_applicability(e.span,
+                                .span_suggestion_with_applicability(
+                                                 e.span,
                                                  &format!("instead, use `break` on its own \
                                                            without a value inside this `{}` loop",
                                                           kind.name()),
index 48972ff386c3c2aca240f507be8186c5de69898d..0b77c0d895bd1754aa81aa920be7edeff2b8c04d 100644 (file)
@@ -3299,7 +3299,8 @@ fn type_ascription_suggestion(&self,
                         err.span_label(base_span,
                                        "expecting a type here because of type ascription");
                         if line_sp != line_base_sp {
-                            err.span_suggestion_short_with_applicability(sp,
+                            err.span_suggestion_short_with_applicability(
+                                                      sp,
                                                       "did you mean to use `;` here instead?",
                                                       ";".to_string(),
                                                       Applicability::Unspecified,