Skip to content

Commit da9ba98

Browse files
committed
Format code
1 parent 70ed4f9 commit da9ba98

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/librustc_mir/hair/pattern/check_match.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,12 +540,16 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor,
540540
"cannot bind by-move into a pattern guard")
541541
.span_label(p.span, "moves value into pattern guard")
542542
.emit();
543-
} else if by_ref_span.is_some() {
544-
struct_span_err!(cx.tcx.sess, p.span, E0009,
545-
"cannot bind by-move and by-ref in the same pattern")
546-
.span_label(p.span, "by-move pattern here")
547-
.span_label(by_ref_span.unwrap(), "both by-ref and by-move used")
548-
.emit();
543+
} else if let Some(by_ref_span) = by_ref_span {
544+
struct_span_err!(
545+
cx.tcx.sess,
546+
p.span,
547+
E0009,
548+
"cannot bind by-move and by-ref in the same pattern",
549+
)
550+
.span_label(p.span, "by-move pattern here")
551+
.span_label(by_ref_span, "both by-ref and by-move used")
552+
.emit();
549553
}
550554
};
551555

src/librustc_save_analysis/span_utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ impl<'a> SpanUtils<'a> {
154154
let loc = self.sess.source_map().lookup_char_pos(span.lo());
155155
span_bug!(
156156
span,
157-
"Mis-counted brackets when breaking path? Parsing '{}' \
158-
in {}, line {}",
157+
"Mis-counted brackets when breaking path? Parsing '{}' in {}, line {}",
159158
self.snippet(span),
160159
loc.file.name,
161160
loc.line

0 commit comments

Comments
 (0)