For example, AtLeast64 is implemented by usize but only if cfg(target_pointer_width = "64"). permalink This means that if I write code like <T: AtLeast64> it's likely to work fine on my box but then fail to compile on other target platforms.
A concrete example of this causing a problem is that the docs state that usize impl Is64 unequivocally, even though this is not always true.
People building software for 32- and 16-bit platforms are probably used to disappointment by now, but I believe that one of the reasons for Rust's success is that its developers tended to err on the side of consistency. For example, Range<u64> does not support .len(), even when targeting 64-bit platforms. playground
For example,
AtLeast64is implemented byusizebut only ifcfg(target_pointer_width = "64"). permalink This means that if I write code like<T: AtLeast64>it's likely to work fine on my box but then fail to compile on other target platforms.A concrete example of this causing a problem is that the docs state that
usize impl Is64unequivocally, even though this is not always true.People building software for 32- and 16-bit platforms are probably used to disappointment by now, but I believe that one of the reasons for Rust's success is that its developers tended to err on the side of consistency. For example,
Range<u64>does not support.len(), even when targeting 64-bit platforms. playground