Make encode_attrs use opt_local_def_id_to_hir_id so we can feed it with None for definitions that have no HIR
This commit is contained in:
parent
f722b24eb9
commit
833b9154ac
4 changed files with 12 additions and 9 deletions
|
@ -85,11 +85,10 @@ rustc_queries! {
|
|||
desc { |tcx| "getting HIR owner of `{}`", tcx.def_path_str(key.to_def_id()) }
|
||||
}
|
||||
|
||||
/// Gives access to the HIR ID for the given `LocalDefId` owner `key`.
|
||||
/// Gives access to the HIR ID for the given `LocalDefId` owner `key` if any.
|
||||
///
|
||||
/// This can be conveniently accessed by methods on `tcx.hir()`.
|
||||
/// Avoid calling this query directly.
|
||||
query local_def_id_to_hir_id(key: LocalDefId) -> hir::HirId {
|
||||
/// Definitions that were generated with no HIR, would be feeded to return `None`.
|
||||
query opt_local_def_id_to_hir_id(key: LocalDefId) -> Option<hir::HirId>{
|
||||
desc { |tcx| "getting HIR ID of `{}`", tcx.def_path_str(key.to_def_id()) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue