Skip to content

Commit 2b166bd

Browse files
authored
Update compiler/rustc_hir_analysis/src/astconv/bounds.rs
1 parent b94498a commit 2b166bd

File tree

1 file changed

+5
-6
lines changed
  • compiler/rustc_hir_analysis/src/astconv

1 file changed

+5
-6
lines changed

compiler/rustc_hir_analysis/src/astconv/bounds.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,11 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
433433
});
434434

435435
// Provide the resolved type of the associated constant to `type_of(AnonConst)`.
436-
if !speculative && let ty::AssocKind::Const = assoc_kind {
437-
let hir::TypeBindingKind::Equality { term: hir::Term::Const(anon_const) } =
438-
binding.kind
439-
else {
440-
bug!()
441-
};
436+
if !speculative
437+
&& let hir::TypeBindingKind::Equality {
438+
term: hir::Term::Const(anon_const),
439+
} = binding.kind
440+
{
442441
let ty = alias_ty.map_bound(|ty| tcx.type_of(ty.def_id).instantiate(tcx, ty.args));
443442
// Since the arguments passed to the alias type above may contain early-bound
444443
// generic parameters, the instantiated type may contain some as well.

0 commit comments

Comments
 (0)