Do not suggest adding a semicolon after `?` by FabianWolff · Pull Request #87061...
source link: https://github.com/rust-lang/rust/pull/87061
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
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 ()
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK