about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2023-10-21 13:16:09 +0200
committerLukas Markeffsky <@>2023-10-21 13:18:00 +0200
commitccc4638d734c745a5ec16fdcce33aac4e8c3b1c0 (patch)
treeb52ffd7afacb59983c8367eb9d67c5d66b58de47 /compiler/rustc_trait_selection/src/traits
parent6f97d838c644174b38413d920ed8d43b70cdc7db (diff)
downloadrust-ccc4638d734c745a5ec16fdcce33aac4e8c3b1c0.tar.gz
rust-ccc4638d734c745a5ec16fdcce33aac4e8c3b1c0.zip
fix spans for removing `.await` on `for` expressions
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index 12a88ac3239..78b466907b3 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -1644,7 +1644,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
             // use nth(1) to skip one layer of desugaring from `IntoIter::into_iter`
             if let Some((_, hir::Node::Expr(await_expr))) = hir.parent_iter(*hir_id).nth(1)
-                && let Some(expr_span) = expr.span.find_ancestor_inside(await_expr.span)
+                && let Some(expr_span) = expr.span.find_ancestor_inside_same_ctxt(await_expr.span)
             {
                 let removal_span = self
                     .tcx