diff options
| author | bors <bors@rust-lang.org> | 2023-11-12 15:44:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-12 15:44:13 +0000 |
| commit | 6a15f3bd49d6ee9127c042153c35130561828b3f (patch) | |
| tree | 255c9e54fdfa8a6efabc7f2f3a90688f95420814 /tests/rustdoc-js-std/parser-slice-array.js | |
| parent | 886d5fbeb08ea38a7ab8f5445891e55d41f88adb (diff) | |
| parent | a44bb079005bac4dca0bdf7d94d5d87c52166674 (diff) | |
| download | rust-6a15f3bd49d6ee9127c042153c35130561828b3f.tar.gz rust-6a15f3bd49d6ee9127c042153c35130561828b3f.zip | |
Auto merge of #11787 - Jarcho:divergence_check, r=dswij
Fixes to `manual_let_else`'s divergence check
A few changes to the divergence check in `manual_let_else` and moves it the implementation to `clippy_utils` since it's generally useful:
* Handle internal `break` and `continue` expressions.
e.g. The first loop is divergent, but the second is not.
```rust
{
loop {
break 'outer;
};
}
{
loop {
break;
};
}
```
* Match rust's definition of divergence which is defined via the type system.
e.g. The following is not considered divergent by rustc as the inner block has a result type of `()`:
```rust
{
'a: {
panic!();
break 'a;
};
}
```
* Handle when adding a single semicolon would make the expression divergent.
e.g. The following would be a divergent if a semicolon were added after the `if` expression:
```rust
{ if panic!() { 0 } else { 1 } }
```
changelog: None
Diffstat (limited to 'tests/rustdoc-js-std/parser-slice-array.js')
0 files changed, 0 insertions, 0 deletions
