Function rustc_const_eval::transform::validate::equal_up_to_regions
source · pub fn equal_up_to_regions<'tcx>(
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
src: Ty<'tcx>,
dest: Ty<'tcx>
) -> bool
Expand description
Returns whether the two types are equal up to lifetimes.
All lifetimes, including higher-ranked ones, get ignored for this comparison.
(This is unlike the erasing_regions
methods, which keep higher-ranked lifetimes for soundness reasons.)
The point of this function is to approximate “equal up to subtyping”. However, the approximation is incorrect as variance is ignored.