Adding 16-bit pointer support

FWIW, there is already a substantial amount of usize == u16 support in rustc, significantly more than for usize == u128. Using the grep string «#[cfg(target_pointer_width = “(16|32|64|128)”)]», here delimited by « and », here are the files which handle usize == u32 and usize == u64 but not usize == u16:

  • lib_alloc/vec_deque.rs
  • libcore/tests/hash/sip.rs
  • librustc_data_structures/fx.rs
  • libserialize/leb128.rs
  • libstd/sys/windows/c.rs
  • sys_common/backtrace.rs
  • test/compile-fail/huge-enum.rs
  • test/compile-fail/issue-17913.rs
  • test/compile-fail/int-exceeding-bitshifts2.rs
  • test/run-pass/enum-discrim-autosizing.rs
  • test/run-pass/extern-types-pointer-cast.rs
  • test/run-pass/huge-largest-array.rs
  • test/run-pass/issue-2895.rs
  • test/run-pass/num-wrapping.rs
  • test/run-pass/struct-return.rs
  • test/run-pass/wrapping_int_api.rs

Edit 1 Note: A larger set of files fail to handle usize == u128. In other words, many files that do not (yet) handle usize == u128 do already handle usize == u16.

Edit 2 Here is the corresponding list of files for usize == u128. Both of these lists were generated from the rustc source as of two days after the release of 1.26.0.

  • lib_alloc/vec_deque.rs
  • libcore/fmt/num.rs
  • libcore/iter/range.rs
  • libcore/num/mod.rs
  • libcore/num/wrapping.rs
  • libcore/tests/hash/sip.rs
  • libcore/tests/iter.rs
  • libcore/tests/mem.rs
  • librustc_data_structures/fx.rs
  • libserialize/leb128.rs
  • sys_common/backtrace.rs
  • test/compile-fail/huge-enum.rs
  • test/compile-fail/issue-17913.rs
  • test/compile-fail/int-exceeding-bitshifts2.rs
  • test/run-pass/const-negation.rs
  • test/run-pass/enum-discrim-autosizing.rs
  • test/run-pass/extern-types-pointer-cast.rs
  • test/run-pass/huge-largest-array.rs
  • test/run-pass/issue-2895.rs
  • test/run-pass/num-wrapping.rs
  • test/run-pass/struct-return.rs
  • test/run-pass/vec-fixed-length.rs
  • test/run-pass/wrapping_int_api.rs

Edit 3: Correctly identified the rustc source that was grep’d.