Literal definition of signed literals have unary - for describe sign of number.
As I think literal is udivide by parts for compiler, but I have example than broke this logic:
(-1i128).pow(-number as u32 + 1) * fib.value
Than I remove braces from -1i128 compile interpret this expression as:
For this to happen in an edition, it would need a lint warning about the change in behaviour. So if you wanted to make progress towards it, consider writing a lint – which may be valuable regardless of whether a change happens if people consider -1i8.abs() confusing.
(I don’t know the rules for clippy vs rustc here.)
I believe - should be part of the integer literal, not a tack-on token. Esp. in light of what @mjbshaw wrote - it IS a literal, so why the minus sign is treated separately?
Can somebody describe the necessary steps for writing such a lint in more detail so that we could implement it and add to rustc (or clippy? not sure) so it can be made part of some edition. I would love to see this changed in a further edition to a more sane semantics where -1u8.abs() returns 1 not -1.