Require a definition in the same file as an impl declaration (#4719)

This PR detects the failures that #4709 fixes.

---------

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2024-12-20 17:00:53 +00:00
committed by GitHub
co-authored by Josh L
parent 661ba36119
commit 5169a1862e
59 changed files with 1157 additions and 562 deletions
+4 -4
View File
@@ -792,7 +792,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template]
// CHECK:STDOUT: %tuple: %tuple.type.4 = tuple_value (%int_1, %int_2.2) [template]
// CHECK:STDOUT: %complete_type.4: <witness> = complete_type_witness %tuple.type.4 [template]
// CHECK:STDOUT: %complete_type.3: <witness> = complete_type_witness %tuple.type.4 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -877,7 +877,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %tuple.type => constants.%tuple.type.4
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.4
// CHECK:STDOUT: %require_complete => constants.%complete_type.3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- deduce_nested_struct.carbon
@@ -907,7 +907,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template]
// CHECK:STDOUT: %struct: %struct_type.a.b.3 = struct_value (%int_1, %int_2.2) [template]
// CHECK:STDOUT: %complete_type.4: <witness> = complete_type_witness %struct_type.a.b.3 [template]
// CHECK:STDOUT: %complete_type.3: <witness> = complete_type_witness %struct_type.a.b.3 [template]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -991,7 +991,7 @@ fn CallImplicitNotDeducible() {
// CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.3
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete => constants.%complete_type.4
// CHECK:STDOUT: %require_complete => constants.%complete_type.3
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon
+2 -2
View File
@@ -187,7 +187,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.5(%int_32) [template]
// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template]
// CHECK:STDOUT: %Defined.specific_fn: <specific function> = specific_function %Defined, @Defined(%i32) [template]
// CHECK:STDOUT: %require_complete.5: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: %require_complete.3: <witness> = require_complete_type %T [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
@@ -256,7 +256,7 @@ fn CallUndefined() -> i32 {
// CHECK:STDOUT: %T.patt.loc4: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4 (constants.%T.patt)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.5)]
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Defined.%T.loc4_12.2 (%T) [symbolic = %require_complete (constants.%require_complete.3)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: %T) -> %T {
// CHECK:STDOUT: !entry: