same_type_modulo_regions

Function same_type_modulo_regions 

Source
pub fn same_type_modulo_regions<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool
Expand description

Checks whether a and b are same types having same Const generic args, but ignores lifetimes.

For example, the function would return true for

  • u32 and u32
  • [u8; N] and [u8; M], if N=M
  • Option<T> and Option<U>, if same_type_modulo_regions(T, U) holds
  • &'a str and &'b str

and false for:

  • Result<u32, String> and Result<usize, String>