zig/test/behavior
Andrew Kelley e66190025f frontend: make fn calls byval; fix false positive isNonErr
This commit does two things which seem unrelated at first, but,
together, solve a miscompilation, and potentially slightly speed up
compiler perf, at the expense of making #2765 trickier to implement in
the future.

Sema: avoid returning a false positive for whether an inferred error set
is comptime-known to be empty.

AstGen: mark function calls as not being interested in a result
location. This prevents the test case "ret_ptr doesn't cause own
inferred error set to be resolved" from being regressed. If we want to
accept and implement #2765 in the future, it will require solving this
problem a different way, but the principle of YAGNI tells us to go ahead
with this change.

Old ZIR looks like this:

  %97 = ret_ptr()
  %101 = store_node(%97, %100)
  %102 = load(%97)
  %103 = ret_is_non_err(%102)

New ZIR looks like this:

  %97 = ret_type()
  %101 = as_node(%97, %100)
  %102 = ret_is_non_err(%101)

closes #15669
2023-07-27 10:12:08 -07:00
..
2023-06-25 14:51:03 -07:00
2023-07-12 15:35:57 -07:00
2023-07-26 19:02:02 -07:00
2023-07-12 15:35:57 -07:00
2023-05-20 17:30:22 +02:00
2023-07-26 19:02:02 -07:00
2023-05-31 18:04:33 +02:00
2023-05-20 17:30:22 +02:00
2023-07-26 22:19:30 -07:00
2023-06-27 19:57:23 -04:00
2022-01-07 00:06:06 -05:00
2023-07-12 15:35:57 -07:00
2023-05-20 18:43:26 +03:30
2023-05-20 17:30:22 +02:00
2023-05-11 20:31:52 +02:00
2023-05-20 17:30:22 +02:00
2023-05-20 17:30:22 +02:00
2023-05-20 17:30:23 +02:00
2023-05-11 20:31:52 +02:00
2023-05-18 20:42:38 -04:00