about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-09-07 07:43:52 +0900
committerGitHub <noreply@github.com>2022-09-07 07:43:52 +0900
commita12e29af922b4db80472be84eadeae92f5e7f1f1 (patch)
tree3ffe744190157e05675f167ac6c68fe1e30eb27c /compiler/rustc_ast_lowering/src
parent631aed82bcd27fc130d41d466bdfd536f8e02d45 (diff)
parent3f45dc1472d2150bfca6d3b88ca29fc16ea24536 (diff)
downloadrust-a12e29af922b4db80472be84eadeae92f5e7f1f1.tar.gz
rust-a12e29af922b4db80472be84eadeae92f5e7f1f1.zip
Rollup merge of #101468 - spastorino:fix-ice-rpit-hrtb-without-dyn, r=cjgillot
fix RPIT ICE for implicit HRTB when missing dyn

Closes #101297

r? `@cjgillot`

cc `@nikomatsakis`
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 3a94c7a91b2..29baa3a80c1 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -1561,8 +1561,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
 
                 LifetimeRes::Fresh { param, binder: _ } => {
                     debug_assert_eq!(lifetime.ident.name, kw::UnderscoreLifetime);
-                    let old_def_id = self.local_def_id(param);
-                    if remapping.get(&old_def_id).is_none() {
+                    if let Some(old_def_id) = self.opt_local_def_id(param) && remapping.get(&old_def_id).is_none() {
                         let node_id = self.next_node_id();
 
                         let new_def_id = self.create_def(