diff options
| author | bors <bors@rust-lang.org> | 2023-11-22 04:49:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-22 04:49:00 +0000 |
| commit | a8b0e5ffad44922973f47c71ed34bc643b68e62c (patch) | |
| tree | 17b434bba9be867d01973ed04e83222b8917228d /tests/codegen/array-codegen.rs | |
| parent | 4d563666b1e36ced2e588a92ab26288ad7daf48e (diff) | |
| parent | a74fa97faba208993073b0d5faf2092063109560 (diff) | |
| download | rust-a8b0e5ffad44922973f47c71ed34bc643b68e62c.tar.gz rust-a8b0e5ffad44922973f47c71ed34bc643b68e62c.zip | |
Auto merge of #11627 - y21:issue11616, r=giraffate
[`needless_return_with_question_mark`]: don't lint if never type is used for coercion
Fixes #11616
When we have something like
```rs
let _x: String = {
return Err(())?;
};
```
we shouldn't suggest removing the `return` because the `!`-ness of `return` is used to coerce the enclosing block to some other type. That will lead to a typeck error without a diverging expression like `return`.
changelog: [`needless_return_with_question_mark`]: don't lint if `return`s never typed-ness is used for coercion
Diffstat (limited to 'tests/codegen/array-codegen.rs')
0 files changed, 0 insertions, 0 deletions
