Skip to content

Commit f96b92f

Browse files
committed
Run fmt
1 parent 2c6f846 commit f96b92f

File tree

1 file changed

+16
-31
lines changed

1 file changed

+16
-31
lines changed

src/librustc_parse/lexer/tokentrees.rs

+16-31
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::{StringReader, UnmatchedBrace};
22

3-
use rustc_ast::token::{self, Token, DelimToken};
3+
use rustc_ast::token::{self, DelimToken, Token};
44
use rustc_ast::tokenstream::{
55
DelimSpan,
66
IsJoint::{self, *},
@@ -238,40 +238,25 @@ impl<'a> TokenTreesReader<'a> {
238238
let mut err =
239239
self.string_reader.sess.span_diagnostic.struct_span_err(self.token.span, &msg);
240240

241-
// Braces are added at the end, so the last element is the biggest block
242-
if let Some(parent) = self.matching_block_spans.last() {
243-
244-
if let Some(span) = self.last_delim_empty_block_spans.remove(&delim) {
245-
// Check if the (empty block) is in the last properly closed block
246-
if (parent.0.to(parent.1)).contains(span) {
247-
err.span_label(
248-
span,
249-
"block is empty, you might have not meant to close it",
250-
);
251-
}
252-
else {
253-
err.span_label(
254-
parent.0,
255-
"this opening brace...",
256-
);
257-
258-
err.span_label(
259-
parent.1,
260-
"...matches this closing brace",
261-
);
262-
}
263-
}
264-
else {
241+
// Braces are added at the end, so the last element is the biggest block
242+
if let Some(parent) = self.matching_block_spans.last() {
243+
if let Some(span) = self.last_delim_empty_block_spans.remove(&delim) {
244+
// Check if the (empty block) is in the last properly closed block
245+
if (parent.0.to(parent.1)).contains(span) {
265246
err.span_label(
266-
parent.0,
267-
"this opening brace...",
247+
span,
248+
"block is empty, you might have not meant to close it",
268249
);
250+
} else {
251+
err.span_label(parent.0, "this opening brace...");
269252

270-
err.span_label(
271-
parent.1,
272-
"...matches this closing brace",
273-
);
253+
err.span_label(parent.1, "...matches this closing brace");
274254
}
255+
} else {
256+
err.span_label(parent.0, "this opening brace...");
257+
258+
err.span_label(parent.1, "...matches this closing brace");
259+
}
275260
}
276261

277262
err.span_label(self.token.span, "unexpected closing delimiter");

0 commit comments

Comments
 (0)