diff options
| author | bors <bors@rust-lang.org> | 2022-10-19 11:12:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-19 11:12:10 +0000 |
| commit | d7dd01fe8b071602510eaac9f676acc0e3cf8e4a (patch) | |
| tree | 85d7503010195d972b60fdbae9277584b67983a1 /compiler/rustc_resolve/src | |
| parent | 5605ed85363345f3def5da6b1ead2ac0b803bfe7 (diff) | |
| parent | 32159e3fa4bc9940f96bfb5fb30120c509ab259a (diff) | |
| download | rust-d7dd01fe8b071602510eaac9f676acc0e3cf8e4a.tar.gz rust-d7dd01fe8b071602510eaac9f676acc0e3cf8e4a.zip | |
Auto merge of #103228 - Dylan-DPC:rollup-31yiauw, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #102863 (Standardize "use parentheses to call" suggestions between typeck and trait selection) - #103034 (Let expressions on RHS shouldn't be terminating scopes) - #103127 (Make transpose const and inline) - #103153 (Allow `Vec::leak` when using `no_global_oom_handling`) - #103182 (Clean up query descriptions) - #103216 (Consider patterns in fn params in an `Elided(Infer)` lifetime rib.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 77ba7a82672..59efb5aff75 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -1862,9 +1862,11 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { let mut bindings = smallvec![(PatBoundCtx::Product, Default::default())]; for (index, (pat, ty)) in inputs.enumerate() { debug!(?pat, ?ty); - if let Some(pat) = pat { - self.resolve_pattern(pat, PatternSource::FnParam, &mut bindings); - } + self.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| { + if let Some(pat) = pat { + this.resolve_pattern(pat, PatternSource::FnParam, &mut bindings); + } + }); self.visit_ty(ty); if let Some(ref candidates) = self.lifetime_elision_candidates { @@ -2834,10 +2836,13 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { fn resolve_params(&mut self, params: &'ast [Param]) { let mut bindings = smallvec![(PatBoundCtx::Product, Default::default())]; - for Param { pat, ty, .. } in params { - self.resolve_pattern(pat, PatternSource::FnParam, &mut bindings); + self.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| { + for Param { pat, .. } in params { + this.resolve_pattern(pat, PatternSource::FnParam, &mut bindings); + } + }); + for Param { ty, .. } in params { self.visit_ty(ty); - debug!("(resolving function / closure) recorded parameter"); } } |
