-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
encode ;
stmt without expr as StmtKind::Empty
#69506
Conversation
Let's see whether this happens to regress perf: @bors try @rust-timer queue |
Awaiting bors try build completion |
encode `;` stmt without expr as `StmtKind::Semi(None)` Instead of encoding `;` statements without a an expression as a tuple in AST, we modify `ast::StmtKind::Semi` to accept an `Option<_>` and then encode the `;` with `StmtKind::Semi(None)`. r? @petrochenkov
☀️ Try build successful - checks-azure |
Queued 1d82a25 with parent 0c15adc, future comparison URL. |
Seems like this resulted in a perf win rather than a regression, ostensibly because we avoid |
Let's make it a separate The semicolon statement is subtly different from macro_rules! empty { () => {} }
fn foo() -> u8 {
{ 0 }
empty!();
}
The PR that turned redundant semicolons into statements in AST for diagnostics walked some dangerous road, I really hope it didn't introduce anything incompatible with the macro expansion plans. |
Hmm... Do you have any naming suggestions? |
It actually regressed some things, but it looks like it's possible to fix them backward-compatibly. macro_rules! empty { () => {} }
fn foo() -> u8 {
{ 0 }
empty!();; // Works on 1.38, error on 1.39
} |
Well. In C++ it's officially known as null statement, but I can't say I like that naming. |
|
fcea184
to
d7291db
Compare
;
stmt without expr as StmtKind::Semi(None)
;
stmt without expr as StmtKind::Empty
Changed to |
d7291db
to
7beba1f
Compare
r=me with the remaining nit addressed. |
7beba1f
to
6a5de13
Compare
@bors r=petrochenkov |
📌 Commit 6a5de134879c7781a713d9b0d23a22aa5fdd5131 has been approved by |
This comment has been minimized.
This comment has been minimized.
@bors r=petrochenkov |
📌 Commit 176fe3f has been approved by |
☀️ Test successful - checks-azure |
📣 Toolstate changed by #69506! Tested on commit 4ad6248. 💔 clippy-driver on windows: test-pass → test-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq). |
Tested on commit rust-lang/rust@4ad6248. Direct link to PR: <rust-lang/rust#69506> 💔 clippy-driver on windows: test-pass → test-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq). 💔 clippy-driver on linux: test-pass → test-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq).
Rustup to rust-lang/rust#69506 changelog: none
Changes: ```` Rustup to rust-lang#69506 Revive rls integration test use question mark operator Add regression test Use `try_eval_usize` over `eval_usize` Add path for display trait Use lang items instead of get_trait_def_id where possible Update stderr Don't lint debug formatting in debug impl Whitelist unused attribute for use items. add test for rust-lang#5238 ````
submodules: update clippy from 8b7f7e6 to 74eae9d Changes: ```` Rustup to #69506 Revive rls integration test use question mark operator Add regression test Use `try_eval_usize` over `eval_usize` Add path for display trait Use lang items instead of get_trait_def_id where possible Update stderr Don't lint debug formatting in debug impl Whitelist unused attribute for use items. add test for #5238 ```` Makes clippy tests pass again. r? @oli-obk
Changes: ```` Apply suggestions from code review Simplify if_chain. Move NumericLiteral to its own module. Included binary and octal cases. Resolve false positives for hex int cast. Test for unnecessary_cast of hex int literal. run-rustfix Lint `if let Some` in question_mark lint Add restrictive pat use in full binded struct Update test case answers to match cargo dev fmt Ran cargo dev fmt Rustup to rust-lang#69506 Recommended changes from flip1995 Revive rls integration test use question mark operator Add regression test Use `try_eval_usize` over `eval_usize` Add path for display trait Use lang items instead of get_trait_def_id where possible Update stderr Don't lint debug formatting in debug impl Whitelist unused attribute for use items. Fix one last test issue Refactor suggested by krishna-veerareddy Fixed compile error from merging Changed test output to reflect cargo fmt Run cargo dev fmt Finished checking for cases of absolute values add test for rust-lang#5238 Some bugfixing Created floating point abs lint and test, but not yet run ````
submodules: update clippy from 8b7f7e6 to 74eae9d Changes: ```` Rustup to #69506 Revive rls integration test use question mark operator Add regression test Use `try_eval_usize` over `eval_usize` Add path for display trait Use lang items instead of get_trait_def_id where possible Update stderr Don't lint debug formatting in debug impl Whitelist unused attribute for use items. add test for #5238 ```` Makes clippy tests pass again. r? @oli-obk
Changes: ```` Apply suggestions from code review Simplify if_chain. Move NumericLiteral to its own module. Included binary and octal cases. Resolve false positives for hex int cast. Test for unnecessary_cast of hex int literal. run-rustfix Lint `if let Some` in question_mark lint Add restrictive pat use in full binded struct Update test case answers to match cargo dev fmt Ran cargo dev fmt Rustup to rust-lang/rust#69506 Recommended changes from flip1995 Revive rls integration test use question mark operator Add regression test Use `try_eval_usize` over `eval_usize` Add path for display trait Use lang items instead of get_trait_def_id where possible Update stderr Don't lint debug formatting in debug impl Whitelist unused attribute for use items. Fix one last test issue Refactor suggested by krishna-veerareddy Fixed compile error from merging Changed test output to reflect cargo fmt Run cargo dev fmt Finished checking for cases of absolute values add test for rust-lang#5238 Some bugfixing Created floating point abs lint and test, but not yet run ````
Instead of encoding
;
statements without a an expression as a tuple in AST, encode it asast::StmtKind::Empty
.r? @petrochenkov