Replace GetInstForSpecific with direct support for rendering a SpecificId in diagnostics. (#5192)

Avoids misbehavior caused by GetInstForSpecific's side effects, such as
recursively reentering constant evaluation.
This commit is contained in:
Richard Smith
2025-03-26 22:53:32 +00:00
committed by GitHub
parent e65866d8c3
commit 4acc9cac5d
35 changed files with 136 additions and 107 deletions
@@ -69,7 +69,7 @@ fn F1();
namespace N;
alias N.F2 = F1;
// CHECK:STDERR: fail_use_poison.carbon:[[@LINE+4]]:14: error: member name `F1` not found in `N` [MemberNameNotFoundInScope]
// CHECK:STDERR: fail_use_poison.carbon:[[@LINE+4]]:14: error: member name `F1` not found in `N` [MemberNameNotFoundInInstScope]
// CHECK:STDERR: alias N.F3 = N.F1;
// CHECK:STDERR: ^~~~
// CHECK:STDERR:
@@ -97,7 +97,7 @@ fn N.F1();
// Failure: `N.F1` used after declaration failed.
// TODO: #4622 - Allow defining a poisoned name so it would be found if used after it's declared.
// CHECK:STDERR: fail_use_declaration_after_poison.carbon:[[@LINE+4]]:14: error: member name `F1` not found in `N` [MemberNameNotFoundInScope]
// CHECK:STDERR: fail_use_declaration_after_poison.carbon:[[@LINE+4]]:14: error: member name `F1` not found in `N` [MemberNameNotFoundInInstScope]
// CHECK:STDERR: alias N.F3 = N.F1;
// CHECK:STDERR: ^~~~
// CHECK:STDERR: