Add (..) syntax for RTN

This commit is contained in:
Michael Goulet 2023-03-16 22:00:08 +00:00
parent 104aacb49f
commit 8b592db27a
44 changed files with 355 additions and 201 deletions

View file

@ -565,7 +565,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
/// type Map = HashMap<String>;
/// ```
fn suggest_adding_args(&self, err: &mut Diagnostic) {
if self.gen_args.parenthesized {
if self.gen_args.parenthesized != hir::GenericArgsParentheses::No {
return;
}
@ -962,7 +962,11 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
let msg = format!(
"remove these {}generics",
if self.gen_args.parenthesized { "parenthetical " } else { "" },
if self.gen_args.parenthesized == hir::GenericArgsParentheses::ParenSugar {
"parenthetical "
} else {
""
},
);
err.span_suggestion(span, &msg, "", Applicability::MaybeIncorrect);