Term and GenericArg currently store pointers as NonZeroUsize, which is not ideal:
They should really work with NonNull pointers and strict provenance APIs like .map_addr, .mask, etc.
See a PR fixing a similar issue for some context: #110243 (note: in that one I ended up rewriting the whole thing, I think this issue requires far less changes).
TermandGenericArgcurrently store pointers asNonZeroUsize, which is not ideal:rust/compiler/rustc_middle/src/ty/generic_args.rs
Line 34 in 92ad4b4
rust/compiler/rustc_middle/src/ty/mod.rs
Line 846 in 92ad4b4
They should really work with
NonNullpointers and strict provenance APIs like.map_addr,.mask, etc.See a PR fixing a similar issue for some context: #110243 (note: in that one I ended up rewriting the whole thing, I think this issue requires far less changes).