about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors.rs
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2024-07-27 05:22:40 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2024-07-27 05:22:40 +0000
commit00e89d3cb6c549d195c41557ee467ddc559b3efe (patch)
tree1facc011e12f747c51718d5acb5dd4f0f9719ed6 /compiler/rustc_hir_analysis/src/errors.rs
parent80a32f86187f897cc075a314cd689c6bd45c4671 (diff)
parenta526d7ce45fd2284e0e7c7556ccba2425b9d25e5 (diff)
downloadrust-00e89d3cb6c549d195c41557ee467ddc559b3efe.tar.gz
rust-00e89d3cb6c549d195c41557ee467ddc559b3efe.zip
Merge from rustc
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs31
1 files changed, 25 insertions, 6 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index c83788928a9..c364a561631 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -22,7 +22,7 @@ pub struct AmbiguousAssocItem<'a> {
     pub span: Span,
     pub assoc_kind: &'static str,
     pub assoc_name: Ident,
-    pub ty_param_name: &'a str,
+    pub qself: &'a str,
 }
 
 #[derive(Diagnostic)]
@@ -75,7 +75,7 @@ pub struct AssocItemNotFound<'a> {
     pub span: Span,
     pub assoc_name: Ident,
     pub assoc_kind: &'static str,
-    pub ty_param_name: &'a str,
+    pub qself: &'a str,
     #[subdiagnostic]
     pub label: Option<AssocItemNotFoundLabel<'a>>,
     #[subdiagnostic]
@@ -126,13 +126,32 @@ pub enum AssocItemNotFoundSugg<'a> {
         assoc_kind: &'static str,
         suggested_name: Symbol,
     },
-    #[suggestion(hir_analysis_assoc_item_not_found_other_sugg, code = "{suggested_name}")]
+    #[multipart_suggestion(
+        hir_analysis_assoc_item_not_found_similar_in_other_trait_qpath_sugg,
+        style = "verbose"
+    )]
+    SimilarInOtherTraitQPath {
+        #[suggestion_part(code = "<")]
+        lo: Span,
+        #[suggestion_part(code = " as {trait_ref}>")]
+        mi: Span,
+        #[suggestion_part(code = "{suggested_name}")]
+        hi: Option<Span>,
+        trait_ref: String,
+        suggested_name: Symbol,
+        identically_named: bool,
+        #[applicability]
+        applicability: Applicability,
+    },
+    #[suggestion(
+        hir_analysis_assoc_item_not_found_other_sugg,
+        code = "{suggested_name}",
+        applicability = "maybe-incorrect"
+    )]
     Other {
         #[primary_span]
         span: Span,
-        #[applicability]
-        applicability: Applicability,
-        ty_param_name: &'a str,
+        qself: &'a str,
         assoc_kind: &'static str,
         suggested_name: Symbol,
     },