Skip to main content

Module hooks

Module hooks 

Source
Expand description

“Hooks” let you write tcx methods in downstream crates and call them in this crate, reducing the amount of code that needs to be in this crate (which is already very big). This is somewhat similar to queries, but queries come with a lot of machinery for caching and incremental compilation, whereas hooks are just plain function pointers without any of the query magic.

Re-exports§

use std::io; 🔒
use rustc_hir::def_id::DefId; 🔒
use rustc_hir::def_id::DefPathHash; 🔒
use rustc_index::bit_set::DenseBitSet; 🔒
use rustc_session::StableCrateId; 🔒
use rustc_span::def_id::CrateNum; 🔒
use rustc_span::def_id::LocalDefId; 🔒
use rustc_span::ExpnHash; 🔒
use rustc_span::ExpnId; 🔒
use rustc_span::bug; 🔒
use crate::mir; 🔒
use crate::query::on_disk_cache::CacheEncoder; 🔒
use crate::ty; 🔒
use crate::ty::Ty; 🔒
use crate::ty::TyCtxt; 🔒

Macros§

declare_hooks 🔒

Structs§

Providers

Functions§

default_hook 🔒