pub trait MaybeTypeckRes<'tcx> {
// Required method
fn typeck_res(&self) -> Option<&TypeckResults<'tcx>>;
// Provided method
fn ty_based_def(&self, node: impl HasHirId) -> Option<(DefKind, DefId)> { ... }
}
Required Methods§
Sourcefn typeck_res(&self) -> Option<&TypeckResults<'tcx>>
fn typeck_res(&self) -> Option<&TypeckResults<'tcx>>
Gets the contained TypeckResults
.
With debug assertions enabled this will always return Some
. None
is
only returned so logic errors can be handled by not emitting a lint on
release builds.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.