rust/compiler/rustc_hir/src
bors c95346b8ac Auto merge of #91557 - cjgillot:ast-lifetimes-named, r=petrochenkov
Perform lifetime resolution on the AST for lowering

Lifetime resolution is currently implemented several times. Once during lowering in order to introduce in-band lifetimes, and once in the resolve_lifetimes query. However, due to the global nature of lifetime resolution and how it interferes with hygiene, it is better suited on the AST.

This PR implements a first draft of lifetime resolution on the AST. For now, we specifically target named lifetimes and everything we need to remove lifetime resolution from lowering. Some diagnostics have already been ported, and sometimes made more precise using available hygiene information. Follow-up PRs will address in particular the resolution of anonymous lifetimes on the AST.

We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.

r? `@petrochenkov`
2022-04-27 23:13:28 +00:00
..
arena.rs Remove deprecated LLVM-style inline assembly 2022-01-12 18:51:31 +01:00
def.rs Stop using CRATE_DEF_INDEX. 2022-04-17 12:14:42 +02:00
def_path_hash_map.rs Use on-disk-hash-table format for DefPathHashMap in hir::definitions. 2021-09-14 13:54:41 +02:00
definitions.rs Stop using CRATE_DEF_INDEX. 2022-04-17 12:14:42 +02:00
diagnostic_items.rs Introduce get_diagnostic_name 2021-10-06 08:40:28 -05:00
hir.rs Auto merge of #91557 - cjgillot:ast-lifetimes-named, r=petrochenkov 2022-04-27 23:13:28 +00:00
hir_id.rs Auto merge of #96082 - michaelwoerister:less_impl_stable_hash_via_hash, r=compiler-errors 2022-04-20 03:51:09 +00:00
intravisit.rs Drop vis in ImplItem. 2022-04-23 09:57:00 +02:00
itemlikevisit.rs fix mention of moved function in rustc_hir docs 2022-02-11 15:38:31 +00:00
lang_items.rs library: Move CStr to libcore, and CString to liballoc 2022-04-14 21:53:11 +03:00
lib.rs add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
pat_util.rs Simplify for loop desugar 2021-11-21 08:15:21 -06:00
stable_hash_impls.rs Remove NodeIdHashingMode. 2022-04-12 19:59:32 +02:00
target.rs add comment about restriction of Target::from_def_kind 2022-04-09 16:03:16 -04:00
tests.rs Revert "Revert "Fix test"" 2021-07-06 11:28:06 +02:00
weak_lang_items.rs Clean up lang_items::extract 2022-01-09 13:41:04 -08:00