Re:When zero cost abstractions aren't zero cost
by hsn915 on Monday August 09, 2021 @10:01PM
(#28124465)
I expect the special case handling for u8 to also apply to types that are just a strong typedef around u8.
[ Parent
| on HN ]
Re:When zero cost abstractions aren't zero cost
by bilkow on Tuesday August 10, 2021 @02:41AM
(#28125754)
Rust has "typedefs" and those are called type aliases.
The intention of the newtype pattern is to specifically create a new type without the behaviour of the wrapped type, so if there's a special case just for u8, I would expect it not to be on the newtype.
Re:When zero cost abstractions aren't zero cost
by jcranberry on Tuesday August 10, 2021 @04:14PM
(#28133763)
A "strong typedef" is not a typedef.