rust/compiler/rustc_middle
Aaron Hill b15cb29a4a
Refactor variance diagnostics to work with more types
Instead of special-casing mutable pointers/references, we
now support general generic types (currently, we handle
`ty::Ref`, `ty::RawPtr`, and `ty::Adt`)

When a `ty::Adt` is involved, we show an additional note
explaining which of the type's generic parameters is
invariant (e.g. the `T` in `Cell<T>`). Currently, we don't
explain *why* a particular generic parameter ends up becoming
invariant. In the general case, this could require printing
a long 'backtrace' of types, so doing this would be
more suitable for a follow-up PR.

We still only handle the case where our variance switches
to `ty::Invariant`.
2021-12-29 18:53:40 -05:00
..
benches
src Refactor variance diagnostics to work with more types 2021-12-29 18:53:40 -05:00
Cargo.toml Bump gsgdt to 0.1.3 2021-12-24 13:46:37 +01:00
README.md

For more information about how rustc works, see the rustc dev guide.