]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/infer/error_reporting/nice_region_error/different_lifetimes.rs
rustc: async fn drop order lowering in HIR
[rust.git] / src / librustc / infer / error_reporting / nice_region_error / different_lifetimes.rs
index 86d7a19bc83090cc1aeb7db4a54294f14b37ec00..46785f7ada1feecd691074f3708c68f8abdb1c20 100644 (file)
@@ -86,19 +86,18 @@ pub(super) fn try_report_anon_anon_conflict(&self) -> Option<ErrorReported> {
         let sub_is_ret_type =
             self.is_return_type_anon(scope_def_id_sub, bregion_sub, ty_fndecl_sub);
 
-        let span_label_var1 = if let Some(simple_ident) = anon_arg_sup.pat.simple_ident() {
-            format!(" from `{}`", simple_ident)
-        } else {
-            String::new()
+        let arg_sup_pat = self.tcx().hir().original_pat_of_argument(anon_arg_sup);
+        let span_label_var1 = match arg_sup_pat.simple_ident() {
+            Some(simple_ident) => format!(" from `{}`", simple_ident),
+            None => String::new(),
         };
 
-        let span_label_var2 = if let Some(simple_ident) = anon_arg_sub.pat.simple_ident() {
-            format!(" into `{}`", simple_ident)
-        } else {
-            String::new()
+        let arg_sub_pat = self.tcx().hir().original_pat_of_argument(anon_arg_sub);
+        let span_label_var2 = match arg_sub_pat.simple_ident() {
+            Some(simple_ident) => format!(" into `{}`", simple_ident),
+            None => String::new(),
         };
 
-
         let (span_1, span_2, main_label, span_label) = match (sup_is_ret_type, sub_is_ret_type) {
             (None, None) => {
                 let (main_label_1, span_label_1) = if ty_sup.hir_id == ty_sub.hir_id {