On 26.06.2014 00:04, Vadim Chugunov wrote: > I wasn't thinking of subtyping u32w to u32. I actually don't think that > u32 should be convertible to u32w (or vice-versa) without an explicit > cast. For array slices, it would have to be a transmute-like function, > e.g. fn as_wrapping<'a>(s:&'a [u32])->&'a [u32w] { unsafe { transmute(s) } } > > FWIW, as I understand it RFC PR #91 <https://github.com/rust-lang/rfcs/pull/91> would nicely deal with such cases, by making `u32` and `u32w` coercible. I don't think there is any reason for `u32w` not to be just a newtype of `u32` with appropriate arithmetic trait impls. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay
- Re: [rust-dev] Integer overflow, round -2147483648 Gregory Maxwell
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay
- Re: [rust-dev] Integer overflow, round -2147483648 Jerry Morrison
- Re: [rust-dev] Integer overflow, round -2147483648 Vadim Chugunov
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay
- Re: [rust-dev] Integer overflow, round -2147483648 Jerry Morrison
- Re: [rust-dev] Integer overflow, round -2147483648 Vadim Chugunov
- Re: [rust-dev] Integer overflow, round -2147483648 Jerry Morrison
- Re: [rust-dev] Integer overflow, round -2147483648 Vadim Chugunov
- Re: [rust-dev] Integer overflow, round -2147483648 Florian Zeitz
- Re: [rust-dev] Integer overflow, round -2147483648 Tony Arcieri
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay
- Re: [rust-dev] Integer overflow, round -2147483648 Tony Arcieri
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay
- Re: [rust-dev] Integer overflow, round -2147483648 Gregory Maxwell
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay
- Re: [rust-dev] Integer overflow, round -2147483648 Igor Bukanov
- Re: [rust-dev] Integer overflow, round -2147483648 Patrick Walton
- Re: [rust-dev] Integer overflow, round -2147483648 Gábor Lehel
- Re: [rust-dev] Integer overflow, round -2147483648 Daniel Micay