about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/structured_errors
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-03-16 22:00:08 +0000
committerMichael Goulet <michael@errs.io>2023-03-28 01:14:28 +0000
commit8b592db27afdc9edac084520bca98508da53c996 (patch)
tree3a2638e8dd3656cfdb5aeed9b68e349efb2c2183 /compiler/rustc_hir_analysis/src/structured_errors
parent104aacb49fb37265fb923e3b779de3c388abd92c (diff)
downloadrust-8b592db27afdc9edac084520bca98508da53c996.tar.gz
rust-8b592db27afdc9edac084520bca98508da53c996.zip
Add `(..)` syntax for RTN
Diffstat (limited to 'compiler/rustc_hir_analysis/src/structured_errors')
-rw-r--r--compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
index cae884ae8fb..8f4d81ec3a9 100644
--- a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
+++ b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
@@ -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);