rust/compiler/rustc_borrowck/src/diagnostics
Nicholas Nethercote f27cab806e 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.
2025-03-19 20:54:10 +11:00
..
bound_region_errors.rs Deeply normalize signature in new solver 2025-02-11 19:24:07 +00:00
conflict_errors.rs Use Option<Ident> for lowered param names. 2025-03-19 20:54:10 +11:00
explain_borrow.rs Fix binding mode problems 2025-02-22 00:13:19 +00:00
find_all_local_uses.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
find_use.rs Remove MirVisitable. 2025-02-19 19:42:17 +11:00
mod.rs Use Option<Ident> for lowered param names. 2025-03-19 20:54:10 +11:00
move_errors.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
mutability_errors.rs Rollup merge of #138384 - nnethercote:hir-ItemKind-idents, r=fmease 2025-03-17 22:49:04 +01:00
opaque_suggestions.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00
outlives_suggestion.rs Remove unnecessary lifetimes in dataflow structs. 2024-09-09 16:14:18 +10:00
region_errors.rs Squash fold into ty 2025-03-15 06:34:36 +00:00
region_name.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00
var_name.rs Move methods from Map to TyCtxt, part 4. 2025-03-12 08:55:37 +11:00