Skip to main content

MaybeTypeckRes

Trait MaybeTypeckRes 

Source
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§

Source

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§

Source

fn ty_based_def(&self, node: impl HasHirId) -> Option<(DefKind, DefId)>

Gets the type-dependent resolution of the specified node.

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'tcx> MaybeTypeckRes<'tcx> for LateContext<'tcx>

Source§

impl<'tcx> MaybeTypeckRes<'tcx> for TypeckResults<'tcx>

Implementors§