rustc_middle::ty::context::tls

Function with_opt

Source
pub fn with_opt<F, R>(f: F) -> R
where F: for<'tcx> FnOnce(Option<TyCtxt<'tcx>>) -> R,
Expand description

Allows access to the TyCtxt in the current ImplicitCtxt. The closure is passed None if there is no ImplicitCtxt available.