rust/compiler/rustc_middle/src
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
..
dep_graph Remove in_band_lifetimes from rustc_middle 2021-12-15 19:50:43 -05:00
hir Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk" 2021-12-12 12:34:46 +08:00
infer Remove in_band_lifetimes from rustc_middle 2021-12-15 19:50:43 -05:00
middle Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr 2021-12-19 12:36:56 +00:00
mir Bump gsgdt to 0.1.3 2021-12-24 13:46:37 +01:00
query rustc_metadata: Encode list of all crate's traits into metadata 2021-12-28 19:31:51 +08:00
thir add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
traits Auto merge of #92167 - pierwill:chalk-update, r=jackh726 2021-12-23 08:59:55 +00:00
ty Refactor variance diagnostics to work with more types 2021-12-29 18:53:40 -05:00
util Use AddAssign impl 2021-11-09 23:47:36 +01:00
arena.rs Fully serialize AdtDef 2021-12-15 16:32:16 -05:00
lib.rs Remove in_band_lifetimes from rustc_middle 2021-12-15 19:50:43 -05:00
lint.rs Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgr 2021-12-19 12:36:56 +00:00
macros.rs Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00