diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-10 14:33:59 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-17 09:50:52 +1000 |
| commit | 097c9c75423db9b11f16300566118dc28d0d9e2e (patch) | |
| tree | e52cc0d9500d71e3fd0751bbd9b4dac21a29b416 /compiler/rustc_interface/src/errors.rs | |
| parent | 4784074753159d55ff0ba7cbe22d343dd0999b5f (diff) | |
| download | rust-097c9c75423db9b11f16300566118dc28d0d9e2e.tar.gz rust-097c9c75423db9b11f16300566118dc28d0d9e2e.zip | |
Replace infallible `name_or_empty` methods with fallible `name` methods.
I'm removing empty identifiers everywhere, because in practice they always mean "no identifier" rather than "empty identifier". (An empty identifier is impossible.) It's better to use `Option` to mean "no identifier" because you then can't forget about the "no identifier" possibility. Some specifics: - When testing an attribute for a single name, the commit uses the `has_name` method. - When testing an attribute for multiple names, the commit uses the new `has_any_name` method. - When using `match` on an attribute, the match arms now have `Some` on them. In the tests, we now avoid printing empty identifiers by not printing the identifier in the `error:` line at all, instead letting the carets point out the problem.
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
