-
Notifications
You must be signed in to change notification settings - Fork 13.4k
HirIdification: add key HirId methods #58090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use hir; | ||
use hir::map::DefPathData; | ||
use hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; | ||
use ty::{self, DefIdTree, Ty, TyCtxt}; | ||
|
@@ -76,6 +77,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { | |
self.item_path_str(self.hir().local_def_id(id)) | ||
} | ||
|
||
// FIXME(@ljedrz): replace the NodeId variant | ||
pub fn hir_path_str(self, id: hir::HirId) -> String { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not use this - #57967 (or the refactoring that it's based on, rather, will split it into a separate PR) removes If you really need to replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eddyb thanks for the heads up, I'll keep that in mind; I'll also remove this function with a drive-by commit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opened #58140 in the meanwhile, and it removes |
||
self.item_path_str(self.hir().local_def_id_from_hir_id(id)) | ||
} | ||
|
||
/// Returns a string identifying this def-id. This string is | ||
/// suitable for user output. It always begins with a crate identifier. | ||
pub fn absolute_item_path_str(self, def_id: DefId) -> String { | ||
|
Uh oh!
There was an error while loading. Please reload this page.