rustc_lint::types

Function get_nullable_type

Source
fn get_nullable_type<'tcx>(
    tcx: TyCtxt<'tcx>,
    param_env: ParamEnv<'tcx>,
    ty: Ty<'tcx>,
) -> Option<Ty<'tcx>>
Expand description

Given a non-null scalar (or transparent) type ty, return the nullable version of that type. If the type passed in was not scalar, returns None.