Merge pull request #2892 from topecongiro/issue-2884
Explicitly handle semicolon after the item in statement position
This commit is contained in:
commit
8cd6633499
@ -90,6 +90,8 @@ fn visit_stmt(&mut self, stmt: &ast::Stmt) {
|
|||||||
match stmt.node {
|
match stmt.node {
|
||||||
ast::StmtKind::Item(ref item) => {
|
ast::StmtKind::Item(ref item) => {
|
||||||
self.visit_item(item);
|
self.visit_item(item);
|
||||||
|
// Handle potential `;` after the item.
|
||||||
|
self.format_missing(stmt.span.hi());
|
||||||
}
|
}
|
||||||
ast::StmtKind::Local(..) | ast::StmtKind::Expr(..) | ast::StmtKind::Semi(..) => {
|
ast::StmtKind::Local(..) | ast::StmtKind::Expr(..) | ast::StmtKind::Semi(..) => {
|
||||||
if contains_skip(get_attrs_from_stmt(stmt)) {
|
if contains_skip(get_attrs_from_stmt(stmt)) {
|
||||||
|
@ -60,6 +60,9 @@ fn foo() -> bool {
|
|||||||
// Check subformatting
|
// Check subformatting
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #2884
|
||||||
|
let _ = [0; {struct Foo; impl Foo {const fn get(&self) -> usize {5}}; Foo.get()}];
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bar() {
|
fn bar() {
|
||||||
|
@ -88,6 +88,17 @@ fn foo() -> bool {
|
|||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #2884
|
||||||
|
let _ = [0; {
|
||||||
|
struct Foo;
|
||||||
|
impl Foo {
|
||||||
|
const fn get(&self) -> usize {
|
||||||
|
5
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Foo.get()
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bar() {
|
fn bar() {
|
||||||
|
Loading…
Reference in New Issue
Block a user