Auto merge of #95758 - compiler-errors:issue-54771, r=estebank
Only suggest removing semicolon when expression is compatible with `impl Trait` https://github.com/rust-lang/rust/issues/54771#issuecomment-476423690 > It still needs checking that the last statement's expr can actually conform to the trait, but the naïve behavior is there. Only suggest removing a semicolon when the type behind the semicolon actually implements the trait in an RPIT `-> impl Trait`. Also upgrade the label that suggests removing the semicolon to a suggestion (should it be verbose?). cc #54771
This commit is contained in:
commit
d00e77078c
15 changed files with 97 additions and 32 deletions
|
@ -936,7 +936,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
} else {
|
||||
err.span_suggestion_short(
|
||||
span_semi,
|
||||
"consider removing this semicolon",
|
||||
"remove this semicolon",
|
||||
String::new(),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue