-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignoring empty statements in closures. #6128
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for another PR. I think we can simplify the implementation of iter_stmts_without_empty
slightly, and I'd like to expand on the test cases that you've already added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding those additional test cases, and for applying the other feedback. Please take a look at my follow up comments when you have a moment.
tests/source/issue-6116/main3.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test case is a great addition! Also wanted to note that you can totally continue to add new files as test cases, though you might find it easier to place all of these test cases into a single file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what I have to do)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm letting you know that instead of creating multiple test files you can add more than one test case to a single file.
for example:
fn foo() -> fn(i32) -> i32 {
|a| {
;
a
}
}
fn bar() -> fn(i32) -> i32 {
|a| {
;
a;
b
}
}
fn foobar() -> fn(i32) -> i32 {
|a| {
;
;
;;;;
a
}
}
fn baz() -> fn(i32) -> i32 {
|a| {
/*comment before empty statement */;
a
}
}
44c5617
to
5d5960d
Compare
Solve #6116