Improve diagnostic by suggesting to remove visibility qualifier

This commit is contained in:
morine0122
2024-04-12 12:40:11 +09:00
parent 30840c53f4
commit ac1bee6493
19 changed files with 77 additions and 44 deletions

View File

@@ -266,7 +266,11 @@ impl<'a> AstValidator<'a> {
return;
}
self.dcx().emit_err(errors::VisibilityNotPermitted { span: vis.span, note });
self.dcx().emit_err(errors::VisibilityNotPermitted {
span: vis.span,
note,
remove_qualifier_sugg: vis.span,
});
}
fn check_decl_no_pat(decl: &FnDecl, mut report_err: impl FnMut(Span, Option<Ident>, bool)) {