about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorsurechen <chenshuo17@huawei.com>2024-09-26 12:35:44 +0800
committersurechen <chenshuo17@huawei.com>2024-09-27 15:41:04 +0800
commitd0165956fe070d12090896aa5546e509045471eb (patch)
treeb20e179b82deee8233884d2f03ab873425bfe29b /compiler/rustc_parse/src/errors.rs
parent1b5aa96d6016bafe50e071b45d4d2e3c90fd766f (diff)
downloadrust-d0165956fe070d12090896aa5546e509045471eb.tar.gz
rust-d0165956fe070d12090896aa5546e509045471eb.zip
Add suggestion for removing invalid path separator `::` in function definition.
for example: `fn invalid_path_separator::<T>() {}`

fixes: #130791
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 20bcefd4fe1..86ed38a96c5 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -1756,6 +1756,14 @@ pub(crate) struct MissingFnParams {
 }
 
 #[derive(Diagnostic)]
+#[diag(parse_invalid_path_sep_in_fn_definition)]
+pub(crate) struct InvalidPathSepInFnDefinition {
+    #[primary_span]
+    #[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
+    pub span: Span,
+}
+
+#[derive(Diagnostic)]
 #[diag(parse_missing_trait_in_trait_impl)]
 pub(crate) struct MissingTraitInTraitImpl {
     #[primary_span]