]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #87061 - FabianWolff:issue-87051, r=oli-obk
authorYuki Okushi <jtitor@2k36.org>
Sun, 11 Jul 2021 19:32:05 +0000 (04:32 +0900)
committerGitHub <noreply@github.com>
Sun, 11 Jul 2021 19:32:05 +0000 (04:32 +0900)
commit5fcefb1d61bd6380020a68db2b26e94192db881d
treeacff12d179cd4cfae3724599e623b07beed99310
parentf3d5fde0702dbcfbb97a6a3145eda8a3c5ff4d5f
parent9946ff227d3b1ec7ee5de9ef9b2f81ee4547df34
Rollup merge of #87061 - FabianWolff:issue-87051, r=oli-obk

Do not suggest adding a semicolon after `?`

Fixes #87051. I have only modified `report_return_mismatched_types()`, i.e. my changes only affect suggestions to add `;` for return type mismatches, but this never makes sense after `?`, because the function cannot return `()` if `?` is used (it has to return a `Result` or an `Option`), and a semicolon won't help if the expected and actual `Err` types differ, even if the expected one is `()`.