rustc_lint::types

Function transparent_newtype_field

Source
pub(crate) fn transparent_newtype_field<'a, 'tcx>(
    tcx: TyCtxt<'tcx>,
    variant: &'a VariantDef,
) -> Option<&'a FieldDef>
Expand description

repr(transparent) structs can have a single non-1-ZST field, this function returns that field.