Skip to content

Commit 8003ccf

Browse files
committed
ty_def_id -> def_id_for_type_of
1 parent a909eb6 commit 8003ccf

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/librustc_middle/ty/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ impl WithOptConstParam<LocalDefId> {
16231623
WithOptConstParam { did: self.did.to_def_id(), const_param_did: self.const_param_did }
16241624
}
16251625

1626-
pub fn ty_def_id(self) -> DefId {
1626+
pub fn def_id_for_type_of(self) -> DefId {
16271627
if let Some(did) = self.const_param_did { did } else { self.did.to_def_id() }
16281628
}
16291629
}
@@ -1653,7 +1653,7 @@ impl WithOptConstParam<DefId> {
16531653
self.did.is_local()
16541654
}
16551655

1656-
pub fn ty_def_id(self) -> DefId {
1656+
pub fn def_id_for_type_of(self) -> DefId {
16571657
self.const_param_did.unwrap_or(self.did)
16581658
}
16591659
}

src/librustc_middle/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@ impl<'tcx> Const<'tcx> {
22312231

22322232
let expr = &tcx.hir().body(body_id).value;
22332233

2234-
let ty = tcx.type_of(def.ty_def_id());
2234+
let ty = tcx.type_of(def.def_id_for_type_of());
22352235

22362236
let lit_input = match expr.kind {
22372237
hir::ExprKind::Lit(ref lit) => Some(LitToConstInput { lit: &lit.node, ty, neg: false }),

src/librustc_mir/borrow_check/universal_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
636636
// For a constant body, there are no inputs, and one
637637
// "output" (the type of the constant).
638638
assert_eq!(self.mir_def.did.to_def_id(), def_id);
639-
let ty = tcx.type_of(self.mir_def.ty_def_id());
639+
let ty = tcx.type_of(self.mir_def.def_id_for_type_of());
640640
let ty = indices.fold_to_region_vids(tcx, &ty);
641641
ty::Binder::dummy(tcx.intern_type_list(&[ty]))
642642
}

src/librustc_ty/instance.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn inner_resolve_instance<'tcx>(
5050
let item = tcx.associated_item(def.did);
5151
resolve_associated_item(tcx, &item, param_env, trait_def_id, substs)
5252
} else {
53-
let ty = tcx.type_of(def.ty_def_id());
53+
let ty = tcx.type_of(def.def_id_for_type_of());
5454
let item_type = tcx.subst_and_normalize_erasing_regions(substs, param_env, &ty);
5555

5656
let def = match item_type.kind {

0 commit comments

Comments
 (0)