mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add opt_rpitit_info query
This commit is contained in:
parent
5423745db8
commit
5295de1694
@ -177,6 +177,7 @@ pub fn provide(providers: &mut Providers) {
|
||||
}
|
||||
};
|
||||
providers.opt_def_kind = |tcx, def_id| tcx.hir().opt_def_kind(def_id.expect_local());
|
||||
providers.opt_rpitit_info = |_, _| None;
|
||||
providers.all_local_trait_impls = |tcx, ()| &tcx.resolutions(()).trait_impls;
|
||||
providers.expn_that_defined = |tcx, id| {
|
||||
let id = id.expect_local();
|
||||
|
@ -1144,6 +1144,14 @@ rustc_queries! {
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
/// The `opt_rpitit_info` query returns the pair of the def id of the function where the RPIT
|
||||
/// is defined and the opaque def id if any.
|
||||
query opt_rpitit_info(def_id: DefId) -> Option<ty::ImplTraitInTraitData> {
|
||||
desc { |tcx| "opt_rpitit_info `{}`", tcx.def_path_str(def_id) }
|
||||
cache_on_disk_if { def_id.is_local() }
|
||||
feedable
|
||||
}
|
||||
|
||||
/// Gets the span for the definition.
|
||||
query def_span(def_id: DefId) -> Span {
|
||||
desc { |tcx| "looking up span for `{}`", tcx.def_path_str(def_id) }
|
||||
|
@ -2071,6 +2071,12 @@ pub enum ImplOverlapKind {
|
||||
Issue33140,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable, HashStable)]
|
||||
pub enum ImplTraitInTraitData {
|
||||
Trait { fn_def_id: DefId, opaque_def_id: DefId },
|
||||
Impl { fn_def_id: DefId },
|
||||
}
|
||||
|
||||
impl<'tcx> TyCtxt<'tcx> {
|
||||
pub fn typeck_body(self, body: hir::BodyId) -> &'tcx TypeckResults<'tcx> {
|
||||
self.typeck(self.hir().body_owner_def_id(body))
|
||||
|
Loading…
Reference in New Issue
Block a user