File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
compiler/rustc_typeck/src/collect Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -430,9 +430,15 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
430430 tcx. adt_def ( tcx. hir ( ) . get_parent_item ( hir_id) ) . repr ( ) . discr_type ( ) . to_ty ( tcx)
431431 }
432432
433- Node :: TypeBinding ( binding @ & TypeBinding { hir_id : binding_id, .. } )
434- if let Node :: TraitRef ( trait_ref) =
435- tcx. hir ( ) . get ( tcx. hir ( ) . get_parent_node ( binding_id) ) =>
433+ Node :: TypeBinding (
434+ binding @ & TypeBinding {
435+ hir_id : binding_id,
436+ kind : TypeBindingKind :: Equality { term : Term :: Const ( ref e) } ,
437+ ..
438+ } ,
439+ ) if let Node :: TraitRef ( trait_ref) =
440+ tcx. hir ( ) . get ( tcx. hir ( ) . get_parent_node ( binding_id) )
441+ && e. hir_id == hir_id =>
436442 {
437443 let Some ( trait_def_id) = trait_ref. trait_def_id ( ) else {
438444 return tcx. ty_error_with_message ( DUMMY_SP , "Could not find trait" ) ;
You can’t perform that action at this time.
0 commit comments