diff options
| author | Vitaly _Vi Shukela <vi0oss@gmail.com> | 2018-09-17 20:13:08 +0300 |
|---|---|---|
| committer | Vitaly _Vi Shukela <vi0oss@gmail.com> | 2018-09-17 20:26:05 +0300 |
| commit | d0790c490a2233d04375072123e70ed158eb3848 (patch) | |
| tree | a02ac12a5038ff424213e53e53468da50b72094e /src | |
| parent | 15982fe369e87d43332556f87f66f7c0e5841830 (diff) | |
| download | rust-d0790c490a2233d04375072123e70ed158eb3848.tar.gz rust-d0790c490a2233d04375072123e70ed158eb3848.zip | |
Whitespace fix again.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs | 4 | ||||
| -rw-r--r-- | src/librustc/session/mod.rs | 10 | ||||
| -rw-r--r-- | src/librustc_borrowck/borrowck/mod.rs | 34 | ||||
| -rw-r--r-- | src/librustc_errors/diagnostic.rs | 6 | ||||
| -rw-r--r-- | src/librustc_passes/loops.rs | 14 | ||||
| -rw-r--r-- | src/librustc_resolve/lib.rs | 18 | ||||
| -rw-r--r-- | src/librustc_typeck/check/cast.rs | 33 | ||||
| -rw-r--r-- | src/librustc_typeck/check/demand.rs | 8 | ||||
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 30 | ||||
| -rw-r--r-- | src/librustc_typeck/check/op.rs | 20 | ||||
| -rw-r--r-- | src/libsyntax/config.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax_ext/format.rs | 6 |
14 files changed, 109 insertions, 100 deletions
diff --git a/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs b/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs index 05af9cffd45..dc0c2fdaf3e 100644 --- a/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs +++ b/src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs @@ -118,8 +118,8 @@ impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> { new_ty.to_string(), Applicability::Unspecified, ) - .span_label(span, format!("lifetime `{}` required", named)) - .emit(); + .span_label(span, format!("lifetime `{}` required", named)) + .emit(); return Some(ErrorReported); } diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 0821e9c4b44..baeec93eb06 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -433,11 +433,11 @@ impl Session { DiagnosticBuilderMethod::SpanSuggestion(suggestion) => { let span = span_maybe.expect("span_suggestion_* needs a span"); diag_builder.span_suggestion_with_applicability( - span, - message, - suggestion, - Applicability::Unspecified, - ); + span, + message, + suggestion, + Applicability::Unspecified, + ); } } } diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index ed84e9a64f5..8902c86c77f 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -868,19 +868,19 @@ impl<'a, 'tcx> BorrowckCtxt<'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, + ); } } _ => { @@ -1344,13 +1344,13 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { 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::MachineApplicable, + 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::MachineApplicable, ) .emit(); self.signal_error(); diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs index f7e5e25c837..2799f2cc81f 100644 --- a/src/librustc_errors/diagnostic.rs +++ b/src/librustc_errors/diagnostic.rs @@ -307,9 +307,9 @@ impl Diagnostic { suggestion: Vec<(Span, String)>, ) -> &mut Self { self.multipart_suggestion_with_applicability( - msg, - suggestion, - Applicability::Unspecified, + msg, + suggestion, + Applicability::Unspecified, ) } diff --git a/src/librustc_passes/loops.rs b/src/librustc_passes/loops.rs index 677345396c1..a87e86aee0c 100644 --- a/src/librustc_passes/loops.rs +++ b/src/librustc_passes/loops.rs @@ -142,12 +142,14 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> { "can only break with a value inside \ `loop` or breakable block") .span_suggestion_with_applicability( - e.span, - &format!("instead, use `break` on its own \ - without a value inside this `{}` loop", - kind.name()), - "break".to_string(), - Applicability::MaybeIncorrect, + e.span, + &format!( + "instead, use `break` on its own \ + without a value inside this `{}` loop", + kind.name() + ), + "break".to_string(), + Applicability::MaybeIncorrect, ) .emit(); } diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 6820fd727db..51062eae97a 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -3300,11 +3300,11 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { "expecting a type here because of type ascription"); if line_sp != line_base_sp { err.span_suggestion_short_with_applicability( - sp, - "did you mean to use `;` here instead?", - ";".to_string(), - Applicability::MaybeIncorrect, - ); + sp, + "did you mean to use `;` here instead?", + ";".to_string(), + Applicability::MaybeIncorrect, + ); } break; } else if snippet.trim().len() != 0 { @@ -4829,8 +4829,12 @@ fn show_candidates(err: &mut DiagnosticBuilder, *candidate = format!("use {};\n{}", candidate, additional_newline); } - err.span_suggestions_with_applicability(span, &msg, path_strings, - Applicability::Unspecified); + err.span_suggestions_with_applicability( + span, + &msg, + path_strings, + Applicability::Unspecified, + ); } else { let mut msg = msg; msg.push(':'); diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index 7fa50fd4f48..85641854e6e 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -299,11 +299,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { err.note("The type information given here is insufficient to check whether \ the pointer cast is valid"); if unknown_cast_to { - err.span_suggestion_short_with_applicability(self.cast_span, - "consider giving more type information", - String::new(), - Applicability::Unspecified, - ); + err.span_suggestion_short_with_applicability( + self.cast_span, + "consider giving more type information", + String::new(), + Applicability::Unspecified, + ); } err.emit(); } @@ -329,11 +330,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { if self.cast_ty.is_trait() { match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) { Ok(s) => { - err.span_suggestion_with_applicability(self.cast_span, - "try casting to a reference instead", - format!("&{}{}", mtstr, s), - Applicability::MachineApplicable, - ); + err.span_suggestion_with_applicability( + self.cast_span, + "try casting to a reference instead", + format!("&{}{}", mtstr, s), + Applicability::MachineApplicable, + ); } Err(_) => { span_help!(err, self.cast_span, "did you mean `&{}{}`?", mtstr, tstr) @@ -350,11 +352,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> { ty::Adt(def, ..) if def.is_box() => { match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) { Ok(s) => { - err.span_suggestion_with_applicability(self.cast_span, - "try casting to a `Box` instead", - format!("Box<{}>", s), - Applicability::MachineApplicable, - ); + err.span_suggestion_with_applicability( + self.cast_span, + "try casting to a `Box` instead", + format!("Box<{}>", s), + Applicability::MachineApplicable, + ); } Err(_) => span_help!(err, self.cast_span, "did you mean `Box<{}>`?", tstr), } diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index b5b7f11be2c..2f597161c32 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -133,10 +133,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let suggestions = compatible_variants.iter() .map(|v| format!("{}({})", v, expr_text)).collect::<Vec<_>>(); err.span_suggestions_with_applicability( - expr.span, - "try using a variant of the expected type", - suggestions, - Applicability::MaybeIncorrect, + expr.span, + "try using a variant of the expected type", + suggestions, + Applicability::MaybeIncorrect, ); } } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index dcec21c9eef..a5a4eaa8cb3 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3349,11 +3349,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let msg = format!("`{}` is a native pointer; try dereferencing it", base); let suggestion = format!("(*{}).{}", base, field); err.span_suggestion_with_applicability( - field.span, - &msg, - suggestion, - Applicability::MaybeIncorrect, - ); + field.span, + &msg, + suggestion, + Applicability::MaybeIncorrect, + ); } _ => {} } @@ -4722,11 +4722,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { ) { if let Some((sp, msg, suggestion)) = self.check_ref(expr, found, expected) { err.span_suggestion_with_applicability( - sp, - msg, - suggestion, - Applicability::MachineApplicable, - ); + sp, + msg, + suggestion, + Applicability::MachineApplicable, + ); } else if !self.check_for_cast(err, expr, found, expected) { let methods = self.get_conversion_methods(expr.span, expected, found); if let Ok(expr_text) = self.sess().source_map().span_to_snippet(expr.span) { @@ -4757,11 +4757,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { }) .collect::<Vec<_>>(); if !suggestions.is_empty() { err.span_suggestions_with_applicability( - expr.span, - "try using a conversion method", - suggestions, - Applicability::MaybeIncorrect, - ); + expr.span, + "try using a conversion method", + suggestions, + Applicability::MaybeIncorrect, + ); } } } diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 7b0cb7ba329..5969f288d73 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -445,10 +445,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { "`+` can't be used to concatenate two `&str` strings"); match source_map.span_to_snippet(lhs_expr.span) { Ok(lstring) => err.span_suggestion_with_applicability( - lhs_expr.span, - msg, - format!("{}.to_owned()", lstring), - Applicability::MachineApplicable, + lhs_expr.span, + msg, + format!("{}.to_owned()", lstring), + Applicability::MachineApplicable, ), _ => err.help(msg), }; @@ -466,12 +466,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { ) { (Ok(l), Ok(r), false) => { err.multipart_suggestion_with_applicability( - msg, - vec![ - (lhs_expr.span, format!("{}.to_owned()", l)), - (rhs_expr.span, format!("&{}", r)), - ], - Applicability::MachineApplicable, + msg, + vec![ + (lhs_expr.span, format!("{}.to_owned()", l)), + (rhs_expr.span, format!("&{}", r)), + ], + Applicability::MachineApplicable, ); } _ => { diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index df202fb6b6d..5d978b6b9e6 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -125,10 +125,10 @@ impl<'a> StripUnconfigured<'a> { let mut err = self.sess.span_diagnostic.struct_span_err(span, msg); if !suggestion.is_empty() { err.span_suggestion_with_applicability( - span, - "expected syntax is", - suggestion.into(), - Applicability::MaybeIncorrect, + span, + "expected syntax is", + suggestion.into(), + Applicability::MaybeIncorrect, ); } err.emit(); diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index bbe49d409ea..214bc9cffc4 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -189,10 +189,10 @@ fn generic_extension<'cx>(cx: &'cx mut ExtCtxt, err.note("you might be missing a comma"); } else { err.span_suggestion_short_with_applicability( - comma_span, - "missing comma here", - ", ".to_string(), - Applicability::MachineApplicable, + comma_span, + "missing comma here", + ", ".to_string(), + Applicability::MachineApplicable, ); } } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 18287189539..6ec1ad969ee 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3883,11 +3883,11 @@ impl<'a> Parser<'a> { // If the struct looks otherwise well formed, recover and continue. if let Some(sp) = comma_sp { err.span_suggestion_short_with_applicability( - sp, - "remove this comma", - String::new(), - Applicability::MachineApplicable, - ); + sp, + "remove this comma", + String::new(), + Applicability::MachineApplicable, + ); } err.emit(); break; diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 1adbbbe2446..31e608de1f8 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -997,9 +997,9 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, } if suggestions.len() > 0 { diag.multipart_suggestion_with_applicability( - "format specifiers use curly braces", - suggestions, - Applicability::MachineApplicable, + "format specifiers use curly braces", + suggestions, + Applicability::MachineApplicable, ); } }}; |
