Closed
Description
Wrapping<T>
is a bit sorry-looking right now. let foo: Wrapping<u8> = 3;
and Wrapping(1) + 1
are type errors, rather than assigning foo
the value Wrapping(3)
and having the value Wrapping(2)
as I expected. You can't even print them.
use std::num::Wrapping;
fn main() {
let x: Wrapping<u8> = Wrapping(47);
println!("{}", x);
}
I asked in #rust
and the consensus was the arithmetic is a little more controversial because of the potential for a combinatoric explosion of impl
s, but that std::fmt
's fun toys are low-effort high-awesome and so warrant filing an issue.
Metadata
Metadata
Assignees
Labels
No labels