about summary refs log tree commit diff
path: root/compiler/rustc_resolve
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-06-10 17:22:32 +0900
committerGitHub <noreply@github.com>2022-06-10 17:22:32 +0900
commitc2355a615d99b8aea0ffbdc35cfa17cd58fe5958 (patch)
tree83ca00e0cfd2b96ac0631e8afb7d3a4089d4ef74 /compiler/rustc_resolve
parent3e5ddb73a8863c5f80243f8a709802cebb4af76f (diff)
parent4d871a25bf96e577992218ac69b449e3648166be (diff)
downloadrust-c2355a615d99b8aea0ffbdc35cfa17cd58fe5958.tar.gz
rust-c2355a615d99b8aea0ffbdc35cfa17cd58fe5958.zip
Rollup merge of #97927 - cjgillot:issue-97836, r=petrochenkov
Do not introduce bindings for types and consts in HRTB.

Fixes https://github.com/rust-lang/rust/issues/97836

r? `@petrochenkov`
Diffstat (limited to 'compiler/rustc_resolve')
-rw-r--r--compiler/rustc_resolve/src/late.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 771eeee965b..45a5adb90cf 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -1981,7 +1981,12 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                     continue;
                 }
             };
-            let res = Res::Def(def_kind, def_id.to_def_id());
+
+            let res = match kind {
+                ItemRibKind(..) | AssocItemRibKind => Res::Def(def_kind, def_id.to_def_id()),
+                NormalRibKind => Res::Err,
+                _ => bug!("Unexpected rib kind {:?}", kind),
+            };
             self.r.record_partial_res(param.id, PartialRes::new(res));
             rib.bindings.insert(ident, res);
         }