4 ms·
I guess Index could be implemented on some type for both u32 and usize and then upcasting a u32 would produce ambiguity.
by jamii 6y ago
I guess Index could be implemented on some type for both u32 and usize and then upcasting a u32 would produce ambiguity.
- estebank 6y agoThis is indeed the main reason array[42u32] isn't supported today: implementing Index on both usize and u32 would make array[42] ambiguous for the type system, it needs to unify the {integer} literal and some implementor of Index, but there are now two possibilities. This would be a breaking change.