rust/compiler/rustc_const_eval/src/interpret
Nicholas Nethercote e9a0c429c5 Overhaul TyS and Ty.
Specifically, change `Ty` from this:
```
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
```
to this
```
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);
```
There are two benefits to this.
- It's now a first class type, so we can define methods on it. This
  means we can move a lot of methods away from `TyS`, leaving `TyS` as a
  barely-used type, which is appropriate given that it's not meant to
  be used directly.
- The uniqueness requirement is now explicit, via the `Interned` type.
  E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather
  than via `TyS`, which wasn't obvious at all.

Much of this commit is boring churn. The interesting changes are in
these files:
- compiler/rustc_middle/src/arena.rs
- compiler/rustc_middle/src/mir/visit.rs
- compiler/rustc_middle/src/ty/context.rs
- compiler/rustc_middle/src/ty/mod.rs

Specifically:
- Most mentions of `TyS` are removed. It's very much a dumb struct now;
  `Ty` has all the smarts.
- `TyS` now has `crate` visibility instead of `pub`.
- `TyS::make_for_test` is removed in favour of the static `BOOL_TY`,
  which just works better with the new structure.
- The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls
  of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned`
  (pointer-based, for the `Equal` case) and partly on `TyS`
  (contents-based, for the other cases).
- There are many tedious sigil adjustments, i.e. adding or removing `*`
  or `&`. They seem to be unavoidable.
2022-02-15 16:03:24 +11:00
..
intrinsics Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk 2021-12-19 09:31:37 +00:00
cast.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
eval_context.rs use body.tainted_by_error to skip loading MIR 2022-02-11 12:45:51 -08:00
intern.rs Remove in_band_lifetimes from rustc_const_eval 2021-12-13 22:39:00 -05:00
intrinsics.rs Rollup merge of #91814 - japm48:spelling-fix, r=RalfJung 2021-12-12 07:45:30 +01:00
machine.rs Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink 2022-01-03 14:44:15 +01:00
memory.rs fix ICE on Miri/CTFE copy of half a pointer 2021-11-13 20:56:01 -05:00
mod.rs Rename rustc_mir to rustc_const_eval. 2021-09-07 20:46:26 +02:00
operand.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
operator.rs comment update 2021-12-14 19:29:29 +03:00
place.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
step.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
terminator.rs don't ICE on variadic function calls 2021-12-20 22:37:14 +01:00
traits.rs Turn tcx.vtable_allocation() into a query. 2021-10-07 20:03:00 +02:00
util.rs update comments 2022-01-20 14:50:35 +01:00
validity.rs Overhaul TyS and Ty. 2022-02-15 16:03:24 +11:00
visitor.rs Rename rustc_mir to rustc_const_eval. 2021-09-07 20:46:26 +02:00