rustc_hir_analysis::impl_wf_check::min_specialization

Function check_static_lifetimes

source
fn check_static_lifetimes<'tcx>(
    tcx: TyCtxt<'tcx>,
    parent_args: &Vec<GenericArg<'tcx>>,
    span: Span,
) -> Result<(), ErrorGuaranteed>
Expand description

Check that 'static lifetimes are not introduced by the specializing impl.

For example forbid the following:

impl<A> Tr for A { }
impl Tr for &'static i32 { }