Skip to main content

## required

# Function required

Source

    pub fn required(tcx: TyCtxt<'_>, lang_item: LangItem) -> bool

Expand description

Returns `true` if the specified `lang_item` must be present for this compilation.

Not all lang items are always required for each compilation, particularly in the case of panic=abort. In these situations some lang items are injected by crates and don’t actually need to be defined in libstd.