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

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.

1 Like

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

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.

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.

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

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.