What rate of importability do we allow (in libstd)?


#1

This is really a minor quibble, if you think it’s uninteresting, let’s just keep it short.

Range<u64> implements the trait ExactSizeIterator when compiled on 64-bit platforms and not on 32-bit platforms. That means it’s reasonably easy to write code that fails to compile on 32-bit.

This was added in PR 19858.

My opinion is that it’s wrong to be implemented at all.


#2

Hm, I think just adding a warning that certain code will not compile in 32bit systems should be enough.


#3

I have similar reservations about std::ffi, which has API using libc::c_char. The actual 8-bit type aliased as c_char may be signed or unsigned depending on the architecture, which means one can write code that compiles on their platform but fails to compile on others. IIRC there is already an AArch64 port where c_char is defined as u8 unlike the other architectures.


#4

In my opinion this is a bug. Unless you are importing from a module that is explicitly platform-specific std code should compile everywhere. I encourage you to file it.


#5

Ok – it’s bug 22047 and I’m probably going to submit a fix just now.