Function rustc_lint::middle::ty::anonymize_late_bound_regionsUnstable [-] [+] [src]

pub fn anonymize_late_bound_regions<'tcx, T>(tcx: &ctxt<'tcx>, sig: &Binder<T>) -> Binder<T> where T: TypeFoldable<'tcx> + Repr<'tcx>

Rewrite any late-bound regions so that they are anonymous. Region numbers are assigned starting at 1 and increasing monotonically in the order traversed by the fold operation.

The chief purpose of this function is to canonicalize regions so that two FnSigs or TraitRefs which are equivalent up to region naming will become structurally identical. For example, for<'a, 'b> fn(&'a isize, &'b isize) and for<'a, 'b> fn(&'b isize, &'a isize) will become identical after anonymization.