Rollup merge of #135383 - BoxyUwU:cov_tag_ptr, r=compiler-errors
De-abstract tagged ptr and make it covariant In #135272 I needed to use a tagged ptr in `hir::TyKind` in order to not regress hir type sizes. Unfortunately the existing `CopyTaggedPtr` abstraction is insufficient as it makes the `'hir` lifetime invariant. I spent some time trying to keep existing functionality while making it covariant but in the end I realised that actually we dont use *any* of this code *anywhere* in rustc, so I've just removed everything and replaced it with a much less general abstraction that is suitable for what I need in #135272. Idk if anyone has a preference for just keeping all the abstractions here in case anyone needs them in the future 🤷♀️
This commit is contained in:
commit
fad3039124
10 changed files with 309 additions and 1003 deletions
|
@ -21,7 +21,7 @@ use crate::arena::Arena;
|
|||
/// pointer.
|
||||
/// - Because of this, you cannot get a `List<T>` that is a sub-list of another
|
||||
/// `List<T>`. You can get a sub-slice `&[T]`, however.
|
||||
/// - `List<T>` can be used with `CopyTaggedPtr`, which is useful within
|
||||
/// - `List<T>` can be used with `TaggedRef`, which is useful within
|
||||
/// structs whose size must be minimized.
|
||||
/// - Because of the uniqueness assumption, we can use the address of a
|
||||
/// `List<T>` for faster equality comparisons and hashing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue