diff options
| author | Lukas Markeffsky <@> | 2023-10-21 13:16:09 +0200 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2023-10-21 13:18:00 +0200 |
| commit | ccc4638d734c745a5ec16fdcce33aac4e8c3b1c0 (patch) | |
| tree | b52ffd7afacb59983c8367eb9d67c5d66b58de47 /compiler/rustc_trait_selection/src/traits | |
| parent | 6f97d838c644174b38413d920ed8d43b70cdc7db (diff) | |
| download | rust-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.rs | 2 |
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 |
