fix internal error when using rustfmt::skip with newline on stmt (#3785)

This commit is contained in:
rChaser53 2019-09-15 23:45:46 +09:00 committed by Seiichi Uchida
parent dfe87fe946
commit 789a097a71
2 changed files with 12 additions and 0 deletions

View file

@ -516,6 +516,11 @@ pub(crate) fn rewrite_block_with_visitor(
let inner_attrs = attrs.map(inner_attributes);
let label_str = rewrite_label(label);
visitor.visit_block(block, inner_attrs.as_ref().map(|a| &**a), has_braces);
let visitor_context = visitor.get_context();
context
.skipped_range
.borrow_mut()
.append(&mut visitor_context.skipped_range.borrow_mut());
Some(format!("{}{}{}", prefix, label_str, visitor.buffer))
}

View file

@ -0,0 +1,7 @@
fn main() {
{
#[rustfmt::skip]
let _ =
[1];
}
}