Files
carbon-lang/toolchain/check/testdata/facet/require_import.carbon
T
Chandler Carruth 2c9739799b Render diagnostics through the terminal library (#7683)
Diagnostic rendering was part of the data model: `Loc::FormatLocation`
and
`Loc::FormatSnippet` wrote plain text to a stream, so no capability,
color, or
terminal width could reach them.

A diagnostic is now one message with labels, contexts, and location
information
attached, and `Diagnostics::Renderer` draws it into a
`Terminal::Buffer`. The
design is in `toolchain/docs/diagnostics_rendering.md` (#7668),
authoring in
`toolchain/docs/diagnostics.md`.

Before:

```
example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments
  Run0(1);
  ^~~~~~~
example.carbon:3:1: note: calling function declared here
fn Run0() {}
^~~~~~~~~~~
```

After:

```
error: 1 argument passed to function expecting 0 arguments
       ╭─┤ example.carbon:6:3
       ┆
     3 │ fn Run0() {}
       · ─────┬─────
       ·      ╰──┤ calling function declared here
       ┆
->   6 │   Run0(1);
       ·   ───────
       ╰────────────
```

`--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`.
File
tests use it; the rendering tests under `toolchain/diagnostics/testdata`
ask for
snippets.

C++ interop diagnostics are data now rather than text Clang drew:
`SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang
location is
marked as the point it names.

`StreamConsumer` moves to a `:renderer` target that `:emitter` does not
depend
on, keeping `common/terminal` out of `consumer.h`. Capabilities come
from the
file behind the error stream, so tests get plain ASCII.

`renderer_fuzzer` draws diagnostics built from fuzzer bytes with every
capability combination, since a shape the renderer doesn't expect must
never be
why the compiler dies while reporting a problem.

TODOs mark the follow-ups: line weights and crossing lines, wrapping
that keeps
a quoted type whole, and ordering diagnostics that share a byte offset.

Also: `IncorrectExtension`'s hint moves into its message, since its note
had no
location of its own, and `strip_noise` in `check_diagnostics.py` blanks
multi-line `#define`s instead of deleting them.

Assisted-by: Claude Code
2026-10-15 06:08:57 +00:00

348 lines
21 KiB
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/facet/require_import.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/require_import.carbon
// --- a.carbon
library "[[@TEST_NAME]]";
interface Z(T: type) {
fn F();
}
interface Y {
extend require impls Z(Self);
}
constraint X {
extend require impls Z(Self);
}
// --- a.impl.carbon
//@include-in-dumps
impl library "[[@TEST_NAME]]";
fn F(generic A: X, unused generic B: Y) {
A.F();
}
// --- fail_todo_symbolic_facet_interface_requires_interface.carbon
library "[[@TEST_NAME]]";
import library "a";
fn F(generic B: Y) {
// TODO: We find the name F, but then fail to do impl lookup for `F` in `B:
// Y` since the identified facet type doesn't include Z. We need to be able to
// find a symbolic facet from the require decl in Y during impl lookup.
//
// CHECK:STDERR: fail_todo_symbolic_facet_interface_requires_interface.carbon:[[@LINE+2]]:3-5: error: cannot access member of interface `Z(B)` in type `B` that does not implement that interface [MissingImplInMemberAccess]
// CHECK:STDERR:
B.F();
}
// CHECK:STDOUT: --- a.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
// CHECK:STDOUT: %X.type: type = facet_type <@X> [concrete]
// CHECK:STDOUT: %Self.f45: %X.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %Self.as_type.190: type = facet_access_type %Self.f45 [symbolic]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
// CHECK:STDOUT: %Z.type.c5f: type = facet_type <@Z, @Z(%T)> [symbolic]
// CHECK:STDOUT: %pattern_type.9a587c.1: type = pattern_type type [concrete]
// CHECK:STDOUT: %T.patt: %pattern_type.9a587c.1 = symbolic_binding_pattern T, 0 [symbolic]
// CHECK:STDOUT: %Self.38b: %Z.type.c5f = symbolic_binding Self, 1 [symbolic]
// CHECK:STDOUT: %Z.assoc_type.795: type = assoc_entity_type @Z, @Z(%T) [symbolic]
// CHECK:STDOUT: %Z.WithSelf.F.type.108: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%T, %Self.38b) [symbolic]
// CHECK:STDOUT: %Z.WithSelf.F.0c9: %Z.WithSelf.F.type.108 = struct_value () [symbolic]
// CHECK:STDOUT: %Z.type.56f318.1: type = facet_type <@Z, @Z(%Self.as_type.190)> [symbolic]
// CHECK:STDOUT: %Self.1df: %Z.type.56f318.1 = symbolic_binding Self, 1 [symbolic]
// CHECK:STDOUT: %require_complete.327231.1: <witness> = require_complete_type %Z.type.56f318.1 [symbolic]
// CHECK:STDOUT: %pattern_type.9a587c.2: type = pattern_type %X.type [concrete]
// CHECK:STDOUT: %A.patt: %pattern_type.9a587c.2 = symbolic_binding_pattern A, 0 [symbolic]
// CHECK:STDOUT: %A: %X.type = symbolic_binding A, 0 [symbolic]
// CHECK:STDOUT: %Y.type: type = facet_type <@Y> [concrete]
// CHECK:STDOUT: %Self.95b: %Y.type = symbolic_binding Self, 0 [symbolic]
// CHECK:STDOUT: %Self.as_type.917: type = facet_access_type %Self.95b [symbolic]
// CHECK:STDOUT: %Z.type.764: type = facet_type <@Z, @Z(%Self.as_type.917)> [symbolic]
// CHECK:STDOUT: %Self.c32: %Z.type.764 = symbolic_binding Self, 1 [symbolic]
// CHECK:STDOUT: %pattern_type.cfb: type = pattern_type %Y.type [concrete]
// CHECK:STDOUT: %B.patt: %pattern_type.cfb = symbolic_binding_pattern B, 1 [symbolic]
// CHECK:STDOUT: %B: %Y.type = symbolic_binding B, 1 [symbolic]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %A.as_type: type = facet_access_type %A [symbolic]
// CHECK:STDOUT: %Z.type.56f318.2: type = facet_type <@Z, @Z(%A.as_type)> [symbolic]
// CHECK:STDOUT: %require_complete.327231.2: <witness> = require_complete_type %Z.type.56f318.2 [symbolic]
// CHECK:STDOUT: %Z.WithSelf.F.type.299: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type, %A) [symbolic]
// CHECK:STDOUT: %Z.WithSelf.F.f23: %Z.WithSelf.F.type.299 = struct_value () [symbolic]
// CHECK:STDOUT: %Z.assoc_type.4e0: type = assoc_entity_type @Z, @Z(%A.as_type) [symbolic]
// CHECK:STDOUT: %assoc0.de7: %Z.assoc_type.4e0 = assoc_entity element0, imports.%Main.import_ref.7eb [symbolic]
// CHECK:STDOUT: %assoc0.a64: %Z.assoc_type.795 = assoc_entity element0, imports.%Main.import_ref.f35 [symbolic]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %A, @Z, @Z(%A.as_type) [symbolic]
// CHECK:STDOUT: %Z.facet: %Z.type.56f318.2 = facet_value %A.as_type, (%Z.lookup_impl_witness) [symbolic]
// CHECK:STDOUT: %Z.WithSelf.F.type.20b: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type, %Z.facet) [symbolic]
// CHECK:STDOUT: %Z.WithSelf.F.53e: %Z.WithSelf.F.type.20b = struct_value () [symbolic]
// CHECK:STDOUT: %.a25: type = fn_type_with_self_type %Z.WithSelf.F.type.20b, %Z.facet [symbolic]
// CHECK:STDOUT: %impl.elem0: %.a25 = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic]
// CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @Z.WithSelf.F(%A.as_type, %Z.facet) [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Main.Z = import_ref Main//a, Z, unloaded
// CHECK:STDOUT: %Main.Y: type = import_ref Main//a, Y, loaded [concrete = constants.%Y.type]
// CHECK:STDOUT: %Main.X: type = import_ref Main//a, X, loaded [concrete = constants.%X.type]
// CHECK:STDOUT: %Main.import_ref.d72: type = import_ref Main//a, loc12_31, loaded [symbolic = @X.WithSelf.%Z.type (constants.%Z.type.56f318.1)]
// CHECK:STDOUT: %Main.import_ref.0f7: @Z.WithSelf.%Z.assoc_type (%Z.assoc_type.795) = import_ref Main//a, loc4_9, loaded [symbolic = @Z.WithSelf.%assoc0 (constants.%assoc0.a64)]
// CHECK:STDOUT: %Main.F = import_ref Main//a, F, unloaded
// CHECK:STDOUT: %Main.import_ref.7eb: @Z.WithSelf.%Z.WithSelf.F.type (%Z.WithSelf.F.type.108) = import_ref Main//a, loc4_9, loaded [symbolic = @Z.WithSelf.%Z.WithSelf.F (constants.%Z.WithSelf.F.0c9)]
// CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//a, loc3_14, loaded [symbolic = @Z.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.c70e4f.2: @Z.%Z.type (%Z.type.c5f) = import_ref Main//a, loc3_22, loaded [symbolic = @Z.%Self (constants.%Self.38b)]
// CHECK:STDOUT: %Main.import_ref.41d0e = import_ref Main//a, loc3_22, unloaded
// CHECK:STDOUT: %Main.import_ref.b3bc94.3: type = import_ref Main//a, loc3_14, loaded [symbolic = @Z.%T (constants.%T)]
// CHECK:STDOUT: %Main.import_ref.5f6: type = import_ref Main//a, loc12_18, loaded [symbolic = @X.WithSelf.Self.as_type.impls.Z.type.require.%Self.as_type (constants.%Self.as_type.190)]
// CHECK:STDOUT: %Main.import_ref.41d02: type = import_ref Main//a, loc12_30, loaded [symbolic = @X.WithSelf.Self.as_type.impls.Z.type.require.%Z.type (constants.%Z.type.56f318.1)]
// CHECK:STDOUT: %Main.import_ref.423e3a.2: %X.type = import_ref Main//a, loc11_14, loaded [symbolic = constants.%Self.f45]
// CHECK:STDOUT: %Main.import_ref.364 = import_ref Main//a, loc11_14, unloaded
// CHECK:STDOUT: %Main.import_ref.872 = import_ref Main//a, loc8_31, unloaded
// CHECK:STDOUT: %Main.import_ref.4f9: type = import_ref Main//a, loc8_18, loaded [symbolic = @Y.WithSelf.Self.as_type.impls.Z.type.require.%Self.as_type (constants.%Self.as_type.917)]
// CHECK:STDOUT: %Main.import_ref.dd1: type = import_ref Main//a, loc8_30, loaded [symbolic = @Y.WithSelf.Self.as_type.impls.Z.type.require.%Z.type (constants.%Z.type.764)]
// CHECK:STDOUT: %Main.import_ref.4b301f.2: %Y.type = import_ref Main//a, loc7_13, loaded [symbolic = constants.%Self.95b]
// CHECK:STDOUT: %Main.import_ref.28a = import_ref Main//a, loc7_13, unloaded
// CHECK:STDOUT: %Main.import_ref.f35 = import_ref Main//a, loc4_9, unloaded
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Z = imports.%Main.Z
// CHECK:STDOUT: .Y = imports.%Main.Y
// CHECK:STDOUT: .X = imports.%Main.X
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %default.import.loc2_17.1 = import <none>
// CHECK:STDOUT: %default.import.loc2_17.2 = import <none>
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %A.patt.loc4_15.1: %pattern_type.9a587c.2 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc4_15.2 (constants.%A.patt)]
// CHECK:STDOUT: %B.patt.loc4_36.1: %pattern_type.cfb = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc4_36.2 (constants.%B.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc4_17: type = splice_block %X.ref [concrete = constants.%X.type] {
// CHECK:STDOUT: %.Self.frozen.loc4_15: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %X.ref: type = name_ref X, imports.%Main.X [concrete = constants.%X.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %A.loc4_15.2: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_15.1 (constants.%A)]
// CHECK:STDOUT: %.loc4_38: type = splice_block %Y.ref [concrete = constants.%Y.type] {
// CHECK:STDOUT: %.Self.frozen.loc4_36: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %Y.ref: type = name_ref Y, imports.%Main.Y [concrete = constants.%Y.type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %B.loc4_36.2: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_36.1 (constants.%B)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic interface @Z(imports.%Main.import_ref.b3bc94.3: type) [from "a.carbon"] {
// CHECK:STDOUT: %T.patt: %pattern_type.9a587c.1 = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%T)> [symbolic = %Z.type (constants.%Z.type.c5f)]
// CHECK:STDOUT: %Self: @Z.%Z.type (%Z.type.c5f) = symbolic_binding Self, 1 [symbolic = %Self (constants.%Self.38b)]
// CHECK:STDOUT:
// CHECK:STDOUT: interface {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.41d0e
// CHECK:STDOUT: .F = imports.%Main.import_ref.0f7
// CHECK:STDOUT: witness = (imports.%Main.F)
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: interface @Y [from "a.carbon"] {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.28a
// CHECK:STDOUT: extend imports.%Main.import_ref.872
// CHECK:STDOUT: witness = ()
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: @Y.WithSelf.Self.as_type.impls.Z.type.require {
// CHECK:STDOUT: require imports.%Main.import_ref.4f9 impls imports.%Main.import_ref.dd1
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: constraint @X [from "a.carbon"] {
// CHECK:STDOUT: !members:
// CHECK:STDOUT: .Self = imports.%Main.import_ref.364
// CHECK:STDOUT: .F = <poisoned>
// CHECK:STDOUT: extend imports.%Main.import_ref.d72
// CHECK:STDOUT:
// CHECK:STDOUT: !requires:
// CHECK:STDOUT: @X.WithSelf.Self.as_type.impls.Z.type.require {
// CHECK:STDOUT: require imports.%Main.import_ref.5f6 impls imports.%Main.import_ref.41d02
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic require @X.WithSelf.Self.as_type.impls.Z.type.require(imports.%Main.import_ref.423e3a.2: %X.type) [from "a.carbon"] {
// CHECK:STDOUT: %Self: %X.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.f45)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.190)]
// CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%Self.as_type)> [symbolic = %Z.type (constants.%Z.type.56f318.1)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic require @Y.WithSelf.Self.as_type.impls.Z.type.require(imports.%Main.import_ref.4b301f.2: %Y.type) [from "a.carbon"] {
// CHECK:STDOUT: %Self: %Y.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self.95b)]
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type.917)]
// CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%Self.as_type)> [symbolic = %Z.type (constants.%Z.type.764)]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Z.WithSelf.F(imports.%Main.import_ref.b3bc94.2: type, imports.%Main.import_ref.c70e4f.2: @Z.%Z.type (%Z.type.c5f)) [from "a.carbon"] {
// CHECK:STDOUT: fn;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F(%A.loc4_15.2: %X.type, %B.loc4_36.2: %Y.type) {
// CHECK:STDOUT: %A.patt.loc4_15.2: %pattern_type.9a587c.2 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc4_15.2 (constants.%A.patt)]
// CHECK:STDOUT: %A.loc4_15.1: %X.type = symbolic_binding A, 0 [symbolic = %A.loc4_15.1 (constants.%A)]
// CHECK:STDOUT: %B.patt.loc4_36.2: %pattern_type.cfb = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc4_36.2 (constants.%B.patt)]
// CHECK:STDOUT: %B.loc4_36.1: %Y.type = symbolic_binding B, 1 [symbolic = %B.loc4_36.1 (constants.%B)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %A.as_type.loc5_4.2: type = facet_access_type %A.loc4_15.1 [symbolic = %A.as_type.loc5_4.2 (constants.%A.as_type)]
// CHECK:STDOUT: %Z.assoc_type: type = assoc_entity_type @Z, @Z(%A.as_type.loc5_4.2) [symbolic = %Z.assoc_type (constants.%Z.assoc_type.4e0)]
// CHECK:STDOUT: %assoc0: @F.%Z.assoc_type (%Z.assoc_type.4e0) = assoc_entity element0, imports.%Main.import_ref.7eb [symbolic = %assoc0 (constants.%assoc0.de7)]
// CHECK:STDOUT: %Z.type: type = facet_type <@Z, @Z(%A.as_type.loc5_4.2)> [symbolic = %Z.type (constants.%Z.type.56f318.2)]
// CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %A.loc4_15.1, @Z, @Z(%A.as_type.loc5_4.2) [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
// CHECK:STDOUT: %Z.facet: @F.%Z.type (%Z.type.56f318.2) = facet_value %A.as_type.loc5_4.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet (constants.%Z.facet)]
// CHECK:STDOUT: %Z.WithSelf.F.type: type = fn_type @Z.WithSelf.F, @Z.WithSelf(%A.as_type.loc5_4.2, %Z.facet) [symbolic = %Z.WithSelf.F.type (constants.%Z.WithSelf.F.type.20b)]
// CHECK:STDOUT: %.loc5_4.3: type = fn_type_with_self_type %Z.WithSelf.F.type, %Z.facet [symbolic = %.loc5_4.3 (constants.%.a25)]
// CHECK:STDOUT: %impl.elem0.loc5_4.2: @F.%.loc5_4.3 (%.a25) = impl_witness_access %Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_4.2 (constants.%impl.elem0)]
// CHECK:STDOUT: %specific_impl_fn.loc5_4.2: <specific function> = specific_impl_function %impl.elem0.loc5_4.2, @Z.WithSelf.F(%A.as_type.loc5_4.2, %Z.facet) [symbolic = %specific_impl_fn.loc5_4.2 (constants.%specific_impl_fn)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref: %X.type = name_ref A, %A.loc4_15.2 [symbolic = %A.loc4_15.1 (constants.%A)]
// CHECK:STDOUT: %A.as_type.loc5_4.1: type = facet_access_type %A.ref [symbolic = %A.as_type.loc5_4.2 (constants.%A.as_type)]
// CHECK:STDOUT: %.loc5_4.1: type = converted %A.ref, %A.as_type.loc5_4.1 [symbolic = %A.as_type.loc5_4.2 (constants.%A.as_type)]
// CHECK:STDOUT: %.loc5_4.2: @F.%Z.assoc_type (%Z.assoc_type.4e0) = specific_constant imports.%Main.import_ref.0f7, @Z.WithSelf(constants.%A.as_type, constants.%A) [symbolic = %assoc0 (constants.%assoc0.de7)]
// CHECK:STDOUT: %F.ref: @F.%Z.assoc_type (%Z.assoc_type.4e0) = name_ref F, %.loc5_4.2 [symbolic = %assoc0 (constants.%assoc0.de7)]
// CHECK:STDOUT: %impl.elem0.loc5_4.1: @F.%.loc5_4.3 (%.a25) = impl_witness_access constants.%Z.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc5_4.2 (constants.%impl.elem0)]
// CHECK:STDOUT: %specific_impl_fn.loc5_4.1: <specific function> = specific_impl_function %impl.elem0.loc5_4.1, @Z.WithSelf.F(constants.%A.as_type, constants.%Z.facet) [symbolic = %specific_impl_fn.loc5_4.2 (constants.%specific_impl_fn)]
// CHECK:STDOUT: %Z.WithSelf.F.call: init %empty_tuple.type = call %specific_impl_fn.loc5_4.1()
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z(constants.%T) {
// CHECK:STDOUT: %T.patt => constants.%T.patt
// CHECK:STDOUT: %T => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf(constants.%T, constants.%Self.38b) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf.F(constants.%T, constants.%Self.38b) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z(constants.%Self.as_type.190) {
// CHECK:STDOUT: %T.patt => constants.%T.patt
// CHECK:STDOUT: %T => constants.%Self.as_type.190
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.1
// CHECK:STDOUT: %Self => constants.%Self.1df
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @X.WithSelf(constants.%Self.f45) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%Self.f45
// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.190
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.1
// CHECK:STDOUT: %require_complete => constants.%require_complete.327231.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @X.WithSelf.Self.as_type.impls.Z.type.require(constants.%Self.f45) {
// CHECK:STDOUT: %Self => constants.%Self.f45
// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.190
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.1
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z(constants.%Self.as_type.917) {
// CHECK:STDOUT: %T.patt => constants.%T.patt
// CHECK:STDOUT: %T => constants.%Self.as_type.917
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Z.type => constants.%Z.type.764
// CHECK:STDOUT: %Self => constants.%Self.c32
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Y.WithSelf(constants.%Self.95b) {}
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Y.WithSelf.Self.as_type.impls.Z.type.require(constants.%Self.95b) {
// CHECK:STDOUT: %Self => constants.%Self.95b
// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type.917
// CHECK:STDOUT: %Z.type => constants.%Z.type.764
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F(constants.%A, constants.%B) {
// CHECK:STDOUT: %A.patt.loc4_15.2 => constants.%A.patt
// CHECK:STDOUT: %A.loc4_15.1 => constants.%A
// CHECK:STDOUT: %B.patt.loc4_36.2 => constants.%B.patt
// CHECK:STDOUT: %B.loc4_36.1 => constants.%B
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @X.WithSelf(constants.%A) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%A
// CHECK:STDOUT: %Self.as_type => constants.%A.as_type
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.2
// CHECK:STDOUT: %require_complete => constants.%require_complete.327231.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z(constants.%A.as_type) {
// CHECK:STDOUT: %T.patt => constants.%T.patt
// CHECK:STDOUT: %T => constants.%A.as_type
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf(constants.%A.as_type, constants.%A) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %T => constants.%A.as_type
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.2
// CHECK:STDOUT: %Self => constants.%A
// CHECK:STDOUT: %Z.WithSelf.F.type => constants.%Z.WithSelf.F.type.299
// CHECK:STDOUT: %Z.WithSelf.F => constants.%Z.WithSelf.F.f23
// CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.4e0
// CHECK:STDOUT: %assoc0 => constants.%assoc0.de7
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @X.WithSelf(constants.%A) [identified] {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %Self => constants.%A
// CHECK:STDOUT: %Self.as_type => constants.%A.as_type
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.2
// CHECK:STDOUT: %require_complete => constants.%require_complete.327231.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @X.WithSelf.Self.as_type.impls.Z.type.require(constants.%A) [identified] {
// CHECK:STDOUT: %Self => constants.%A
// CHECK:STDOUT: %Self.as_type => constants.%A.as_type
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf(constants.%A.as_type, constants.%Z.facet) {
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %T => constants.%A.as_type
// CHECK:STDOUT: %Z.type => constants.%Z.type.56f318.2
// CHECK:STDOUT: %Self => constants.%Z.facet
// CHECK:STDOUT: %Z.WithSelf.F.type => constants.%Z.WithSelf.F.type.20b
// CHECK:STDOUT: %Z.WithSelf.F => constants.%Z.WithSelf.F.53e
// CHECK:STDOUT: %Z.assoc_type => constants.%Z.assoc_type.4e0
// CHECK:STDOUT: %assoc0 => constants.%assoc0.de7
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Z.WithSelf.F(constants.%A.as_type, constants.%Z.facet) {}
// CHECK:STDOUT: