about summary refs log tree commit diff
path: root/compiler/rustc_passes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-15 03:28:55 +0000
committerbors <bors@rust-lang.org>2021-12-15 03:28:55 +0000
commit195e931b02b69bbce1bcf4632f4e2d5603ef006b (patch)
treef56ab523ec6f2a40e2ed60e80fc27f420bfe24f9 /compiler/rustc_passes
parentd594910a2da12f158477b4c7281716f535cfa3de (diff)
parent22fc403757b4e1bbe91375781b33fe51db8030c2 (diff)
downloadrust-195e931b02b69bbce1bcf4632f4e2d5603ef006b.tar.gz
rust-195e931b02b69bbce1bcf4632f4e2d5603ef006b.zip
Auto merge of #91945 - matthiaskrgr:rollup-jszf9zp, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #90939 (Tweak errors coming from `for`-loop, `?` and `.await` desugaring)
 - #91859 (Iterator::cycle() — document empty iterator special case)
 - #91868 (Use `OutputFilenames` to generate output file for `-Zllvm-time-trace`)
 - #91870 (Revert setting a default for the MACOSX_DEPLOYMENT_TARGET env var for linking)
 - #91881 (Stabilize `iter::zip`)
 - #91882 (Remove `in_band_lifetimes` from `rustc_typeck`)
 - #91940 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_passes')
-rw-r--r--compiler/rustc_passes/src/lib.rs1
-rw-r--r--compiler/rustc_passes/src/region.rs11
2 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_passes/src/lib.rs b/compiler/rustc_passes/src/lib.rs
index d01b74930c9..d6528364e98 100644
--- a/compiler/rustc_passes/src/lib.rs
+++ b/compiler/rustc_passes/src/lib.rs
@@ -7,7 +7,6 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
 #![feature(crate_visibility_modifier)]
 #![feature(in_band_lifetimes)]
-#![feature(iter_zip)]
 #![feature(map_try_insert)]
 #![feature(min_specialization)]
 #![feature(nll)]
diff --git a/compiler/rustc_passes/src/region.rs b/compiler/rustc_passes/src/region.rs
index ae423070392..8968c163987 100644
--- a/compiler/rustc_passes/src/region.rs
+++ b/compiler/rustc_passes/src/region.rs
@@ -421,11 +421,14 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
         // Mark this expr's scope and all parent scopes as containing `yield`.
         let mut scope = Scope { id: expr.hir_id.local_id, data: ScopeData::Node };
         loop {
-            let data = YieldData {
-                span: expr.span,
-                expr_and_pat_count: visitor.expr_and_pat_count,
-                source: *source,
+            let span = match expr.kind {
+                hir::ExprKind::Yield(expr, hir::YieldSource::Await { .. }) => {
+                    expr.span.shrink_to_hi().to(expr.span)
+                }
+                _ => expr.span,
             };
+            let data =
+                YieldData { span, expr_and_pat_count: visitor.expr_and_pat_count, source: *source };
             visitor.scope_tree.yield_in_scope.insert(scope, data);
             if visitor.pessimistic_yield {
                 debug!("resolve_expr in pessimistic_yield - marking scope {:?} for fixup", scope);