rust/compiler/rustc_borrowck/src
Matthias Krüger e1acc68c9d
Rollup merge of #138384 - nnethercote:hir-ItemKind-idents, r=fmease
Move `hir::Item::ident` into `hir::ItemKind`.

 `hir::Item` has an `ident` field.

- It's always non-empty for these item kinds: `ExternCrate`, `Static`, `Const`, `Fn`, `Macro`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`, Trait`, TraitAalis`.

- It's always empty for these item kinds: `ForeignMod`, `GlobalAsm`, `Impl`.

- For `Use`, it is non-empty for `UseKind::Single` and empty for `UseKind::{Glob,ListStem}`.

All of this is quite non-obvious; the only documentation is a single comment saying "The name might be a dummy name in case of anonymous items". Some sites that handle items check for an empty ident, some don't. This is a very C-like way of doing things, but this is Rust, we have sum types, we can do this properly and never forget to check for the exceptional case and never YOLO possibly empty identifiers (or possibly dummy spans) around and hope that things will work out.

This is step towards `kw::Empty` elimination (#137978).

r? `@fmease`
2025-03-17 22:49:04 +01:00
..
constraints Split the Edges iterator. 2025-02-28 09:25:01 +11:00
diagnostics Rollup merge of #138384 - nnethercote:hir-ItemKind-idents, r=fmease 2025-03-17 22:49:04 +01:00
polonius Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
region_infer Fold visit into ty 2025-03-15 06:34:36 +00:00
type_check Auto merge of #138532 - matthiaskrgr:rollup-mgcynqu, r=matthiaskrgr 2025-03-15 11:40:17 +00:00
borrow_set.rs rename BitSet to DenseBitSet 2025-01-11 11:34:01 +00:00
borrowck_errors.rs Use closure parse code 2025-03-06 17:58:32 -03:00
consumers.rs rename AllFacts to PoloniusFacts 2025-01-08 13:23:54 +00:00
dataflow.rs move out of scope precomputer code 2025-01-12 07:39:20 +00:00
def_use.rs Rollup merge of #126013 - nnethercote:unreachable_pub, r=Urgau 2024-08-27 00:41:57 +02:00
lib.rs Flatten and simplify some control flow 2025-03-17 09:15:49 +00:00
member_constraints.rs Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
nll.rs record boring locals in polonius context 2025-01-31 11:04:50 +00:00
path_utils.rs remove borrowck duplicate of std::ops::ControlFlow 2025-01-01 12:13:33 +00:00
place_ext.rs Remove #[macro_use] extern crate tracing from rustc_borrowck. 2024-08-30 17:14:53 +10:00
places_conflict.rs Implement MIR, CTFE, and codegen for unsafe binders 2025-01-31 17:19:53 +00:00
prefixes.rs Implement MIR, CTFE, and codegen for unsafe binders 2025-01-31 17:19:53 +00:00
renumber.rs Squash fold into ty 2025-03-15 06:34:36 +00:00
session_diagnostics.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
universal_regions.rs Auto merge of #138532 - matthiaskrgr:rollup-mgcynqu, r=matthiaskrgr 2025-03-15 11:40:17 +00:00
used_muts.rs Remove unnecessary lifetimes in dataflow structs. 2024-09-09 16:14:18 +10:00