Invalid comment cleanup (#4836)

This is a followup from #4834, I searched for "invalid" uses in our
codebase. This is mostly changing comments, and a couple debug
functions, but shouldn't affect testable behavior.

Note a couple things I'll highlight as not changing (but could) are:
- `ReturnTypeInfo::is_valid`
- `"invalid"` uses in the formatter
- `AddInvalid` for `!has_value` in `inst_fingerprinter` (because the
cases it's called sound invalid-ish)
This commit is contained in:
Jon Ross-Perkins
2025-01-23 02:21:48 +00:00
committed by GitHub
parent 6b5eb1a101
commit 9c0faf007e
41 changed files with 115 additions and 119 deletions
+3 -3
View File
@@ -262,8 +262,8 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
}
if (had_error) {
context.AddNameToLookup(name_id, SemIR::ErrorInst::SingletonInstId);
// Replace the parameter with an invalid instruction so that we don't
// try constructing a generic based on it.
// Replace the parameter with `ErrorInst` so that we don't try
// constructing a generic based on it.
param_pattern_id = SemIR::ErrorInst::SingletonInstId;
} else {
auto pattern_inst_id = make_binding_pattern();
@@ -321,7 +321,7 @@ auto HandleParseNode(Context& context,
if (context.decl_introducer_state_stack().innermost().kind ==
Lex::TokenKind::Let) {
// Disallow `let` outside of function and interface definitions.
// TODO: Find a less brittle way of doing this. An invalid scope_inst_id
// TODO: Find a less brittle way of doing this. A `scope_inst_id` of `None`
// can represent a block scope, but is also used for other kinds of scopes
// that aren't necessarily part of an interface or function decl.
auto scope_inst_id = context.scope_stack().PeekInstId();