This patch introduces a rank struct to be used instead of the int that is normally used to represent the rank of a conversion.