Decide allocator kind to codegen. If Some(_) this will be the same as
tcx.allocator_kind, but it may be None in more cases (e.g. if using
allocator definitions from a dylib dependency).
Returns rhs sufficiently masked, truncated, and/or extended so that it can be used to shift
lhs: it has the same size as lhs, and the value, when interpreted unsigned (no matter its
type), will not exceed the size of lhs.
This function returns all of the debugger visualizers specified for the
current crate as well as all upstream crates transitively that match the
visualizer_type specified.
Codegen takes advantage of the additional assumption, where if the
principal trait def id of what’s being casted doesn’t change,
then we don’t need to adjust the vtable at all. This
corresponds to the fact that dyn Tr<A>: Unsize<dyn Tr<B>>
requires that A = B; we don’t allow upcasting objects
between the same trait with different args. If we, for
some reason, were to relax the Unsize trait, it could become
unsound, so let’s validate here that the trait refs are subtypes.