Currently Rust allows Unicode subscripts in identifiers with
non_ascii_idents turned on, i.e.
xᵢ = 2 is allowed. I’ve noticed that Unicode superscripts are not allowed, i.e.
σ² = 1 is not OK. This is because superscripts do not have the XID continue property.
I’ve in the process of porting over some math-heavy code from Haskell, and Unicode subscripts and superscripts makes the code much prettier and readable. As my first contribution to the great open source project that is Rust, I would like to add support for Unicode superscripts by allowing identifiers to be extended by either a character with the
XID continue property or if it is a superscript .
What do you think about this change? Are you in support or do you have any concerns?