Skip to content

Commit c6131b2

Browse files
committed
rename hir::map::opt_local_def_id*
1 parent 37d7e1f commit c6131b2

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/librustc/hir/map/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'hir> Map<'hir> {
220220
}
221221

222222
pub fn def_path_from_hir_id(&self, id: HirId) -> Option<DefPath> {
223-
self.opt_local_def_id_from_hir_id(id).map(|def_id| {
223+
self.opt_local_def_id(id).map(|def_id| {
224224
self.def_path(def_id)
225225
})
226226
}
@@ -232,7 +232,7 @@ impl<'hir> Map<'hir> {
232232

233233
#[inline]
234234
pub fn local_def_id_from_node_id(&self, node: NodeId) -> DefId {
235-
self.opt_local_def_id(node).unwrap_or_else(|| {
235+
self.opt_local_def_id_from_node_id(node).unwrap_or_else(|| {
236236
let hir_id = self.node_to_hir_id(node);
237237
bug!("local_def_id_from_node_id: no entry for `{}`, which has a map of `{:?}`",
238238
node, self.find_entry(hir_id))
@@ -248,13 +248,13 @@ impl<'hir> Map<'hir> {
248248
}
249249

250250
#[inline]
251-
pub fn opt_local_def_id_from_hir_id(&self, hir_id: HirId) -> Option<DefId> {
251+
pub fn opt_local_def_id(&self, hir_id: HirId) -> Option<DefId> {
252252
let node_id = self.hir_to_node_id(hir_id);
253253
self.definitions.opt_local_def_id(node_id)
254254
}
255255

256256
#[inline]
257-
pub fn opt_local_def_id(&self, node: NodeId) -> Option<DefId> {
257+
pub fn opt_local_def_id_from_node_id(&self, node: NodeId) -> Option<DefId> {
258258
self.definitions.opt_local_def_id(node)
259259
}
260260

src/librustc_save_analysis/dump_visitor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
12171217
let access = access_from!(self.save_ctxt, root_item, hir_id);
12181218

12191219
// The parent `DefId` of a given use tree is always the enclosing item.
1220-
let parent = self.save_ctxt.tcx.hir().opt_local_def_id(id)
1220+
let parent = self.save_ctxt.tcx.hir().opt_local_def_id_from_node_id(id)
12211221
.and_then(|id| self.save_ctxt.tcx.parent(id))
12221222
.map(id_from_def_id);
12231223

@@ -1367,7 +1367,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tcx, '
13671367
let name_span = item.ident.span;
13681368
if !self.span.filter_generated(name_span) {
13691369
let span = self.span_from_span(name_span);
1370-
let parent = self.save_ctxt.tcx.hir().opt_local_def_id(item.id)
1370+
let parent = self.save_ctxt.tcx.hir().opt_local_def_id_from_node_id(item.id)
13711371
.and_then(|id| self.save_ctxt.tcx.parent(id))
13721372
.map(id_from_def_id);
13731373
self.dumper.import(

src/librustc_save_analysis/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ fn id_from_def_id(id: DefId) -> rls_data::Id {
11931193
}
11941194

11951195
fn id_from_node_id(id: NodeId, scx: &SaveContext<'_, '_>) -> rls_data::Id {
1196-
let def_id = scx.tcx.hir().opt_local_def_id(id);
1196+
let def_id = scx.tcx.hir().opt_local_def_id_from_node_id(id);
11971197
def_id.map(|id| id_from_def_id(id)).unwrap_or_else(|| {
11981198
// Create a *fake* `DefId` out of a `NodeId` by subtracting the `NodeId`
11991199
// out of the maximum u32 value. This will work unless you have *billions*

src/librustdoc/visit_ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
6666
}
6767

6868
fn stability(&self, id: hir::HirId) -> Option<attr::Stability> {
69-
self.cx.tcx.hir().opt_local_def_id_from_hir_id(id)
69+
self.cx.tcx.hir().opt_local_def_id(id)
7070
.and_then(|def_id| self.cx.tcx.lookup_stability(def_id)).cloned()
7171
}
7272

7373
fn deprecation(&self, id: hir::HirId) -> Option<attr::Deprecation> {
74-
self.cx.tcx.hir().opt_local_def_id_from_hir_id(id)
74+
self.cx.tcx.hir().opt_local_def_id(id)
7575
.and_then(|def_id| self.cx.tcx.lookup_deprecation(def_id))
7676
}
7777

0 commit comments

Comments
 (0)