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> {
35
35
ExprKind :: MethodCall ( segment, ..) | ExprKind :: Path ( QPath :: TypeRelative ( _, segment) ) ,
36
36
..
37
37
} ) => {
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 ) ) ;
39
39
let tables = tcx. typeck_tables_of ( body_owner. to_def_id ( ) ) ;
40
40
// This may fail in case the method/path does not actually exist.
41
41
// 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> {
74
74
| ExprKind :: Struct ( & QPath :: Resolved ( _, path) , ..) ,
75
75
..
76
76
} ) => {
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 ) ) ;
78
78
let _tables = tcx. typeck_tables_of ( body_owner. to_def_id ( ) ) ;
79
79
& * path
80
80
}
You can’t perform that action at this time.
0 commit comments