rust/src
Matthias Krüger 915576935a
Rollup merge of #138685 - nnethercote:use-Option-Ident-for-lowered-param-names, r=compiler-errors
Use `Option<Ident>` for lowered param names.

Parameter patterns are lowered to an `Ident` by `lower_fn_params_to_names`, which is used when lowering bare function types, trait methods, and foreign functions. Currently, there are two exceptional cases where the lowered param can become an empty `Ident`.

- If the incoming pattern is an empty `Ident`. This occurs if the parameter is anonymous, e.g. in a bare function type.

- If the incoming pattern is neither an ident nor an underscore. Any such parameter will have triggered a compile error (hence the `span_delayed_bug`), but lowering still occurs.

This commit replaces these empty `Ident` results with `None`, which eliminates a number of `kw::Empty` uses, and makes it impossible to fail to check for these exceptional cases.

Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It actually should have been removed in #138482, the precursor to this PR. That PR changed the lowering of wild patterns to `_` symbols instead of empty symbols, which made the mentioned underscore check load-bearing.

r? ``@compiler-errors``
2025-03-20 15:36:17 +01:00
..
bootstrap Use -Wunused_crate_dependencies for compiler crates. 2025-03-20 08:59:43 +11:00
build_helper Add post-merge analysis CI workflow 2025-03-07 09:43:52 +01:00
ci Auto merge of #138693 - matthiaskrgr:rollup-ejq8mwp, r=matthiaskrgr 2025-03-19 12:39:34 +00:00
doc Rollup merge of #138655 - Kobzol:rdg-sync, r=jieyouxu 2025-03-19 08:17:15 +01:00
etc replace config.toml to bootstrap.toml in src/ci, src/etc/* and tests/run-make 2025-03-17 12:56:49 +05:30
gcc@48664a6cab Revert "add fix for full tools and sanitizer" 2025-03-04 17:38:06 +08:00
librustdoc Use Option<Ident> for lowered param names. 2025-03-19 20:54:10 +11:00
llvm-project@acaea3d2bb Update to LLVM 20.1.1 2025-03-19 10:36:30 +01:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types Add RTN support to rustdoc 2025-03-15 18:13:27 +00:00
tools Rollup merge of #138685 - nnethercote:use-Option-Ident-for-lowered-param-names, r=compiler-errors 2025-03-20 15:36:17 +01:00
README.md
stage0 bump stage0 2025-02-18 08:51:01 -08:00
version Bump to version 1.87.0 2025-02-14 09:55:45 -08:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.