fix internal error when using rustfmt::skip with newline on stmt (#3785)
This commit is contained in:
parent
dfe87fe946
commit
789a097a71
2 changed files with 12 additions and 0 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
7
tests/target/issue-3717.rs
Normal file
7
tests/target/issue-3717.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
fn main() {
|
||||
{
|
||||
#[rustfmt::skip]
|
||||
let _ =
|
||||
[1];
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue