rust/compiler/rustc_borrowck/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
..
constraints Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
diagnostics Refactor variance diagnostics to work with more types 2021-12-29 18:53:40 -05:00
region_infer Store impl_trait_fn inside OpaqueTyOrigin. 2021-12-07 21:30:45 +01:00
type_check Store a DefId instead of an AdtDef in AggregateKind::Adt 2021-12-22 14:36:34 -05:00
borrow_set.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
borrowck_errors.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
constraint_generation.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
consumers.rs Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts 2021-10-06 19:07:56 -07:00
dataflow.rs Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
def_use.rs Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
facts.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
invalidation.rs Add initial AST and MIR support for unwinding from inline assembly 2021-12-03 23:51:46 +01:00
lib.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
location.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
member_constraints.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
nll.rs Rename functions reflect that inline const is also "typeck_child" 2021-11-07 04:00:34 +00:00
path_utils.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
place_ext.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
places_conflict.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
prefixes.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
renumber.rs Visit type in process_projection_elem. 2021-11-27 17:39:27 +01:00
universal_regions.rs Rename functions reflect that inline const is also "typeck_child" 2021-11-07 04:00:34 +00:00
used_muts.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00