Closed pickx closed 1 year ago
Hey, nice find! Luckily, not much is broken in practice. The only result is that the following call is possible:
let a: u7 = u7::new(1).widen()
Which is - while pointless - also fine.
I'll upload a patch to make widen officially support equal bitlengths and remove the SMALLER_THAN check. This way if anyone's using the current behavior (e.g. in autogenerated code) things will work as before.
both
CompileTimeAssert::SMALLER_THAN_EQUAL
andCompileTimeAssert::SMALLER_THAN
assert thatA <= B
.hopefully I didn't miss something obvious, but I'd expect
SMALLER_THAN
to assert thatA < B
.