Uh oh!
There was an error while loading. Please reload this page.
Suggest adding a semicolon to a closure without block - #97371
Conversation
This transforms `|| expr` into `|| { expr; }`.rust-highfive
commented
May 24, 2022
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
oli-obk
left a comment
There was a problem hiding this comment.
Just some code golfing, logic is sound.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| err: &mut Diagnostic, | ||
| expression: &'tcx hir::Expr<'tcx>, | ||
| expected: Ty<'tcx>, | ||
| needs_block: bool, |
There was a problem hiding this comment.
Not a fan of the bool argument, but I can't come up with anything clearer right now
There was a problem hiding this comment.
Neither am I :) Maybe an enum will do?
…`suggest_missing_semicolon()`
oli-obk
commented
May 31, 2022
@bors r+ |
bors
commented
May 31, 2022
📌 Commit 6afaffb has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#97089 (Improve settings theme display) - rust-lang#97229 (Document the current aliasing rules for `Box<T>`.) - rust-lang#97371 (Suggest adding a semicolon to a closure without block) - rust-lang#97455 (Stabilize `toowned_clone_into`) - rust-lang#97565 (Add doc alias `memset` to `write_bytes`) - rust-lang#97569 (Remove `memset` alias from `fill_with`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This transforms
|| exprinto|| { expr; }.Closes#97359.