File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/librustc_typeck/collect Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ pub(super) fn const_param_of(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
3535 ExprKind :: MethodCall ( segment, ..) | ExprKind :: Path ( QPath :: TypeRelative ( _, segment) ) ,
3636 ..
3737 } ) => {
38- let body_owner = tcx. hir ( ) . get_parent_did ( parent_node_id ) ;
38+ let body_owner = tcx. hir ( ) . local_def_id ( tcx . hir ( ) . enclosing_body_owner ( hir_id ) ) ;
3939 let tables = tcx. typeck_tables_of ( body_owner. to_def_id ( ) ) ;
4040 // This may fail in case the method/path does not actually exist.
4141 // As there is no relevant param for `def_id`, we simply return
@@ -74,7 +74,7 @@ pub(super) fn const_param_of(tcx: TyCtxt<'_>, def_id: DefId) -> Option<DefId> {
7474 | ExprKind :: Struct ( & QPath :: Resolved ( _, path) , ..) ,
7575 ..
7676 } ) => {
77- let body_owner = tcx. hir ( ) . get_parent_did ( parent_node_id ) ;
77+ let body_owner = tcx. hir ( ) . local_def_id ( tcx . hir ( ) . enclosing_body_owner ( hir_id ) ) ;
7878 let _tables = tcx. typeck_tables_of ( body_owner. to_def_id ( ) ) ;
7979 & * path
8080 }
You can’t perform that action at this time.
0 commit comments