about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorShrey Sudhir <shrey.somaiya@gmail.com>2022-12-01 14:12:33 +0000
committerSpanishPear <shrey.somaiya@gmail.com>2023-01-22 17:05:38 +1100
commit655beb4ece8a116c664ae63f26811ba75aa9e0e7 (patch)
tree9f59db889965d5ec537564e697c7b89fbc2a2330 /compiler/rustc_parse/src/parser
parent5287004aa4f9b0685197cc0c009237812fed7047 (diff)
downloadrust-655beb4ece8a116c664ae63f26811ba75aa9e0e7.tar.gz
rust-655beb4ece8a116c664ae63f26811ba75aa9e0e7.zip
Attempt to address review comments via github web...
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 1e1e804c0d3..94bedc07ba1 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -352,13 +352,12 @@ impl<'a> Parser<'a> {
                             // if there is a `<` after the fn name, then don't show a suggestion, show help
 
                             if !self.look_ahead(1, |t| *t == token::Lt) &&
-                                let Ok(snippet) = self.sess.source_map().span_to_snippet(generic.span) &&
-                                let Ok(ident) = self.sess.source_map().span_to_snippet(self.token.span) {
+                                let Ok(snippet) = self.sess.source_map().span_to_snippet(generic.span) {
                                     err.span_suggestion_verbose(
                                         self.token.span.shrink_to_hi(),
                                         format!("place the generic parameter name after the {ident_name} name"),
                                         snippet,
-                                        Applicability::MachineApplicable,
+                                        Applicability::MaybeIncorrect,
                                     );
                                 } else {
                                     err.help(format!(