Add associated_items_for_impl_trait_in_trait query
This commit is contained in:
parent
833b9154ac
commit
4e703a2772
9 changed files with 68 additions and 4 deletions
|
@ -849,6 +849,13 @@ impl<'hir> Map<'hir> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_fn_output(self, def_id: LocalDefId) -> Option<&'hir FnRetTy<'hir>> {
|
||||
match self.tcx.hir_owner(OwnerId { def_id }) {
|
||||
Some(Owner { node, .. }) => node.fn_decl().map(|fn_decl| &fn_decl.output),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn expect_variant(self, id: HirId) -> &'hir Variant<'hir> {
|
||||
match self.find(id) {
|
||||
Some(Node::Variant(variant)) => variant,
|
||||
|
|
|
@ -767,6 +767,13 @@ rustc_queries! {
|
|||
desc { |tcx| "comparing impl items against trait for `{}`", tcx.def_path_str(impl_id) }
|
||||
}
|
||||
|
||||
/// Given an `fn_def_id`, create and return the associated items for that function.
|
||||
query associated_items_for_impl_trait_in_trait(fn_def_id: DefId) -> &'tcx [DefId] {
|
||||
desc { |tcx| "creating associated items for impl trait in trait returned by `{}`", tcx.def_path_str(fn_def_id) }
|
||||
cache_on_disk_if { fn_def_id.is_local() }
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
/// Given an `impl_id`, return the trait it implements.
|
||||
/// Return `None` if this is an inherent impl.
|
||||
query impl_trait_ref(impl_id: DefId) -> Option<ty::EarlyBinder<ty::TraitRef<'tcx>>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue