rust/src/librustdoc
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
..
clean Move hir::Item::ident into hir::ItemKind. 2025-03-18 06:29:50 +11:00
doctest Move hir::Item::ident into hir::ItemKind. 2025-03-18 06:29:50 +11:00
formats librustdoc: flatten nested ifs 2025-03-06 08:16:28 +00:00
html Rollup merge of #138384 - nnethercote:hir-ItemKind-idents, r=fmease 2025-03-17 22:49:04 +01:00
json Add RTN support to rustdoc 2025-03-15 18:13:27 +00:00
passes Move hir::Item::ident into hir::ItemKind. 2025-03-18 06:29:50 +11:00
theme rustdoc: merge theme css into rustdoc.css 2023-09-15 07:40:17 -07:00
build.rs Auto merge of #136253 - notriddle:notriddle/aot-minify, r=GuillaumeGomez 2025-02-05 18:28:16 +00:00
Cargo.toml librustdoc: 2024 edition! 🎊 2025-03-04 12:35:18 +02:00
config.rs Use materialize_sysroot in rustdoc 2025-03-12 15:05:25 +00:00
core.rs Make opts.maybe_sysroot non-optional 2025-03-12 15:05:24 +00:00
display.rs x clippy src/librustdoc --fix 2025-03-06 16:06:41 +00:00
docfs.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
doctest.rs Rollup merge of #138404 - bjorn3:sysroot_handling_cleanup, r=petrochenkov,jieyouxu 2025-03-13 11:28:35 +01:00
error.rs Fix clippy lints 2024-08-29 12:14:41 +02:00
externalfiles.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
fold.rs Rename TyMethodItem -> RequiredMethodItem 2024-12-19 10:48:51 -08:00
lib.rs librustdoc: 2024 edition! 🎊 2025-03-04 12:35:18 +02:00
lint.rs Fix new clippy lints 2024-11-28 03:05:43 +01:00
markdown.rs rustdoc: Document markdown module. 2024-10-19 13:37:40 +00:00
README.md rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00
rinja.toml Replace askama with rinja 2024-07-23 11:19:55 +02:00
scrape_examples.rs Move methods from Map to TyCtxt, part 3. 2025-02-21 14:31:09 +11:00
theme.rs Fix new clippy lints 2024-11-28 03:05:43 +01:00
visit.rs Rename TyMethodItem -> RequiredMethodItem 2024-12-19 10:48:51 -08:00
visit_ast.rs Move hir::Item::ident into hir::ItemKind. 2025-03-18 06:29:50 +11:00
visit_lib.rs librustdoc: flatten nested ifs 2025-03-06 08:16:28 +00:00

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