rust/clippy_utils/src
bors 07a7603994 Auto merge of #10187 - dswij:issue-10182-semicolon, r=Jarcho
[needless_return]: Remove all semicolons on suggestion

Closes #10182

Multiple semicolons currently breaks autofix for `needless_return` suggestions. Any semicolons left after removing return means that the return type will always be `()`, and thus fail to compile.

This PR allows `needless_return` to remove multiple semicolons.

The change won't cover the case where there is multiple line yet.

i.e.

```rust
fn needless_return() -> bool {
    return true;
;;
}
```

---

changelog: Sugg: [`needless_return`]: Now removes all semicolons on the same line
[#10187](https://github.com/rust-lang/rust-clippy/pull/10187)
<!-- changelog_checked -->
2023-01-15 15:49:40 +00:00
..
ast_utils Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
mir Adjust old code for newer rustc version. 2023-01-12 13:29:23 -05:00
ast_utils.rs Rename Rptr to Ref in AST and HIR 2022-12-28 18:52:36 +01:00
attrs.rs Merge commit 'd822110d3b' into clippyup 2022-12-01 18:29:38 +01:00
check_proc_macro.rs Add StrStyle to ast::LitKind::ByteStr. 2022-12-02 10:38:58 +11:00
comparisons.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
consts.rs Merge commit '4f3ab69ea0' into clippyup 2022-12-29 14:28:34 +01:00
diagnostics.rs Merge commit '4f3ab69ea0' into clippyup 2022-12-29 14:28:34 +01:00
eager_or_lazy.rs Merge commit 'd822110d3b' into clippyup 2022-12-01 18:29:38 +01:00
higher.rs Merge commit 'd9ddce8a22' into clippyup 2022-06-04 13:34:07 +02:00
hir_utils.rs Rename Rptr to Ref in AST and HIR 2022-12-28 18:52:36 +01:00
lib.rs Auto merge of #10187 - dswij:issue-10182-semicolon, r=Jarcho 2023-01-15 15:49:40 +00:00
macros.rs Merge commit '4bdfb0741d' into clippyup 2022-12-17 14:12:54 +01:00
msrvs.rs Restrict suggestion of deriving Default for enums to MSRV 1.62. 2023-01-05 13:06:43 -08:00
numeric_literal.rs Use token::Lit in ast::ExprKind::Lit. 2022-11-16 09:41:28 +11:00
paths.rs hotfix: remove ITER_COUNT since it is not called 2023-01-07 22:57:30 +09:00
ptr.rs Merge commit 'ac0e10aa68' into clippyup 2022-10-06 09:44:38 +02:00
qualify_min_const_fn.rs Merge commit '4bdfb0741d' into clippyup 2022-12-17 14:12:54 +01:00
source.rs Merge commit 'd822110d3b' into clippyup 2022-12-01 18:29:38 +01:00
str_utils.rs Merge commit '0eff589afc' into clippyup 2021-12-30 15:10:43 +01:00
sugg.rs Auto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgr 2022-12-29 19:40:06 +00:00
sym_helper.rs Merge commit '928e72dd10' into clippyup 2021-02-25 11:25:22 +01:00
ty.rs Rename Rptr to Ref in AST and HIR 2022-12-28 18:52:36 +01:00
usage.rs rustc_hir: Relax lifetime requirements on Visitor::visit_path 2022-12-01 17:04:02 +03:00
visitors.rs chore 2023-01-07 20:44:02 +09:00