TYCHO Search

Search documentation

    ↑ ↓ to move · Enter to open · Esc to close

    Appendix E — Conformance test map

    This appendix maps each normative clause of the specification to the fixture(s) that exercise it. Every cited fixture exists; clauses with no dedicated fixture are flagged in E.2.1.

    E.1 The conformance oracle

    Conformance is defined against this specification (§1.3), and checked against the fixture corpus below: across the conformance suite an implementation MUST accept every program the suite records as accepted, reject every program it records as must-fail, and reproduce each behavioral fixture's recorded output. The suite is drawn from:

    E.2 The coverage matrix

    §3 Lexical structure

    ClauseRequirement (abbrev.)Fixture(s)
    §3.2one logical statement per linetests/reject/two_stmts_one_line, reject/bare_expr_stmt
    §3.4indentation; mixed tabs/spaces rejectedtests/tab_indent, reject/tab_mix, reject/tab_mix2
    §3.5.1a run-time binding must start lowercase or _tests/reject/upper_local, tests/reject/upper_param, tests/match_expr, tests/nested_pattern
    §3.9.1integer literals; overflow rejectedtests/float_int_lit, reject/int_literal_overflow
    §3.9.2float literals (exp / leading-dot forms)tests/float_exp, tests/float_dot, reject/float_exp_bad
    §3.9.3character literalstests/char_basic, tests/char_byte
    §3.9.3\xNN: exactly two hex digits, either case; char literals onlytests/char_hex_escape, reject/hex_escape_one_digit, reject/hex_escape_in_string
    §3.9.4string literals; escapes; interior NULtests/multiline_literals, tests/string_nul, reject/string_escape
    §3.9.4\r escape; adjacent-literal join (multi-line string)tests/crlf_adjacent, plus corelib/test/csv, corelib/test/httpd (\r) and server/main.ty's error_body/usage (join)
    §3.9.5f-string escape ruletests/reject/fstring_escape

    §5 Types

    ClauseRequirement (abbrev.)Fixture(s)
    §5.1distinct type identity (no erasure)tests/reject/char_as_type, reject/newtype_key_mix, reject/newtype_agg_mix
    §5.2.1int = required 64-bit two's-complement (range, defined wrap)tests/int_overflow
    §5.2.1int stays 64-bit under a non-LP64 C data model (no truncation of values, literal arithmetic or length headers)tests/int64_width, the make ilp32 lane (whole suite rebuilt gcc -m32, 64-bit goldens unchanged)
    §5.2.3char is not inttests/char_ops, reject/char_int_eq, reject/char_int_mul, reject/char_int_ord
    §5.2.4to_char(n): int -> char, aborting outside 0..255tests/char_to_char, tests/abort/chr_oob
    §16.8the char row of the element-wise table (+ - only), reached by inference since char has no keywordtests/char_elem_ops, reject/char_elem_mul, reject/char_elem_div, reject/char_elem_mod
    §5.2.6bytes operators: b[i] yields int (not a 1-length bytes) and is not a place; b[i:j] yields bytes and clamps; a + b and b + 'c' concatenate; no implicit string mixing; every one byte-safe across an interior 0x00corelib/test/io (byte_index, byte_slice, byte_cat, byte_rebuild), the §5.2.6 example (scripts/spec_check.sh), server/main.ty (log_safe); no tests/ fixture
    §5.2.7fixed-width u32/u64/f32tests/sized_ints, tests/sized_family, corelib/test/sha256
    §5.3.2fixed-size arrays [N]Ttests/fixed_array, reject/fixed_array_bad_length, reject/fixed_array_zero_size, reject/fixed_array_nonconst_size
    §5.3.5maps; composite keystests/maps, tests/map_literal_composite_key, tests/mapstructkey, tests/vector_map_key, reject/map_as_key, reject/map_key_enum_leaf, reject/map_key_bytes_top
    §5.3.9typed handles (affine, RAII free)tests/ffi (use_res_close), reject/close_handle_nonvar
    §5.3.10bounded[N]T inline fixed capacity; runtime count; push traps when fulltests/bounded, tests/bounded_const_cap, reject/fixarr_into_bounded_arg, reject/bounded_nonconst_cap, reject/bounded_const_cap_zero, reject/bounded_chan_elem, reject/bounded_task_elem
    §5.4newtypes; unwrap; key/agg mixing rejectedtests/newtypes, tests/newtype_key, reject/newtype_key_mix
    §5.5structural ==; functions not comparabletests/map_eq, tests/option_eq, eqparity lane, reject/fn_eq

    §6 Type inference

    ClauseRequirement (abbrev.)Fixture(s)
    §6.3:= / typed-decl synthesistests/inference, reject/result_bare_decl
    §6.4pending (ungrounded) types rejectedtests/reject/infer_bare_empty, reject/infer_use_before_ground
    §6.2(7)a tuple literal is checked element-wise (a Result element grounds)tests/result_tuple, corelib/test/result (outcome)
    §6.5branch unification for value if/matchtests/if_expr, tests/match_expr, reject/if_expr_type_mismatch

    §7 Generics

    ClauseRequirement (abbrev.)Fixture(s)
    §7.2where predicate accept/rejecttests/generic_where, reject/where_numeric, reject/where_unknown_pred, reject/where_nongeneric
    §7.2hashable/defaultable predicatestests/generic_hashable, tests/generic_defaultable, reject/where_hashable_bad, reject/zero_bad_type
    §7.4const generics [N]T / [$N]Ttests/const_generic_size, reject/const_generic_size_return_only, reject/const_generic_size_struct_field, reject/const_generic_size_dynamic_arg
    §7.5explicit type args f$(T)tests/generic_explicit, reject/explicit_count, reject/explicit_noarg, reject/explicit_nongeneric
    §7.6generic UFCS method-style callstests/generic_ufcs
    §7.7variadic (generic) parameterstests/variadic, reject/variadic_not_last, reject/variadic_empty_generic, reject/variadic_spread_mixed

    §8 Conversions

    ClauseRequirement (abbrev.)Fixture(s)
    §8.1literal adaptation to context typetypeparity lane, tests/floats
    §8.3newtype unwrappingtests/newtype_elem_unwrap, tests/newtype_strbool
    §8.4no implicit narrowing (hard error)tests/reject/coerce_annot_narrow, reject/coerce_arg_narrow, reject/coerce_return_narrow, reject/coerce_array_mixed
    §8.5out-of-range conversion abortstests/abort/to_int_oob

    §9–11 Memory & object model

    ClauseRequirement (abbrev.)Fixture(s)
    §9.2copy on assign / argument / returntests/value_semantics, tests/move, tests/ctor_move
    §9.3structural == mirrors the copytests/map_eq, tests/option_eq, eqparity lane
    §10.2escape rule (closures re-home)tests/closures, tests/closure_fncap, tests/closure_loop_fuse
    §11.1inout copy-in / copy-outtests/inout_string, tests/scalar_elem_inout
    §11.2inout exclusivity (aliasing rejected)tests/reject/inout_alias, reject/inout_byval_alias, reject/slice_inout_alias
    §11.4sink move conventiontests/sink, reject/sink_use_after
    §11.5types that cannot be inout (channel, function value)tests/reject/chan_inout_param, reject/inout_fnvalue, tests/chan_param_recv

    §12 Declarations & scoping

    ClauseRequirement (abbrev.)Fixture(s)
    §12.2const (literal/folded); reassign/nonliteral rejectedtests/const_toplevel, tests/const_expr, reject/const_reassign, reject/const_expr_divzero, reject/const_expr_localref
    §12.2const folds + over two string literalstests/crlf_adjacent (GREET)
    §12.3scope & shadowing rulestests/shadow_string, tests/shadow_call, reject/param_shadow, reject/dup_local
    §12.4compound assignmenttests/compound_assign, tests/compound_index_eval
    §12.5name resolution; unknown name rejectedtests/reject/unknown_var, reject/unknown_type, reject/unknown_fn_stmt

    §13 Expressions

    ClauseRequirement (abbrev.)Fixture(s)
    §13.1place expressionstests/delete_place, tests/option_place_store, tests/projections
    §13.2binary operators; in membershiptests/bitops, tests/logic, reject/in_array, reject/in_string, reject/in_wrong_key
    §13.3unary - ~ nottests/shift_edge, unaryparity lane
    §13.4evaluation order; subject evaluated oncetests/compound_index_eval, tests/match_subject_once
    §13.4place-evaluation order: every place leg left-to-right, before the RHStests/place_eval_order, tests/eval_order
    §13.4compound assignment through a user subscript: the argument is evaluated oncetests/compound_subscript_eval
    §13.4f-string holes are sequenced left-to-righttests/fstring_eval_order
    §13.5expression-valued if/match (tail)tests/if_expr, tests/match_expr, tests/match_inline, reject/if_expr_no_else, reject/match_expr_nonexhaustive
    §13.5multi-statement value arms (block ending in a value expr)tests/if_expr_block, tests/match_expr_block, reject/value_arm_no_tail
    §13.6closures & function valuestests/closures, tests/funcvalues, tests/combinator, reject/infer_lambda_param

    §14 Statements & control flow

    ClauseRequirement (abbrev.)Fixture(s)
    §14.4the four loop shapes: condition, infinite, three-clause (ascending and descending), foreachtests/foreach, tests/while_loop, tests/for3, tests/for_bare, tests/range_negative_step
    §14.4all three clauses required; range() removed; 0..<N refused outside parallel forreject/for3_empty_clause, tests/diag/range_removed, reject/dotlt_sequential, tests/diag/dotlt_sequential — diagnostic text is pinned byte-for-byte by the tests/diag/ fixtures
    §14.4break / continue; continue runs the three-clause post clausetests/break_continue, tests/loop_return, tests/for3
    §19.4match statement; exhaustive; wildcard-lasttests/enums, tests/matchwild, reject/match_non_exhaustive, reject/match_dup_arm, reject/match_wildcard_not_last
    §14.3.1nested patterns on an Ok/Err/Some payload; unqualified variant; refined-before-unrefined ordering; exhaustive by refined coveragetests/nested_pattern, corelib/test/result (why, io_why)

    §15 Functions

    ClauseRequirement (abbrev.)Fixture(s)
    §15.1declaration; duplicate/no-main rejectedtests/early_return_main, reject/dup_fn, reject/no_main
    §15.1at most 16 parameters (fn and extern fn)tests/params_16_max, reject/params_17, reject/extern_params_17
    §15.2parameter passing modestests/inout_string, tests/sink, reject/mut_arg_no_amp
    §15.3variadic parameterstests/variadic
    §15.5methods (UFCS)tests/methods, tests/pkg/methods, tests/pkg/methodscalar
    §15.6subscripts (yielding projections)tests/subscript, reject/subscript_dangling, reject/subscript_not_place, reject/subscript_param_twice, reject/subscript_type_mismatch

    §16–19 Aggregates

    ClauseRequirement (abbrev.)Fixture(s)
    §16.2indexing & bounds; OOB abortstests/abort/index_oob, tests/bounds_elision
    §16.4growth push; in-place append; alias guardtests/push_fusion, tests/append_alias, reject/push_scalar
    §16.6slicestests/slices, tests/string_slice, reject/slice_inout_alias
    §16.7element-type restriction: void rejected everywhere; bool legal as a dynamic element, rejected in the inline fixed formstests/bool_array, tests/cond_stmt_expr, reject/fixarr_elem_bool, reject/bounded_elem_bool
    §16.8element-wise arithmetic; broadcast (order kept, literal adapts); fresh result; [N]T mismatch rejected, [T] mismatch abortstests/array_arith, tests/array_bcast, tests/array_arith_fresh, tests/array_bcast_fresh, tests/abort/array_arith_len, reject/array_arith_fixlen, tests/diag/array_arith_fixlen, tests/diag/array_bcast_widen
    §17.1struct construction & fieldstests/named_fields, tests/recursive_structs
    §17.3recursion only through a containertests/recursive_structs, tests/recursive_enum_array
    §17.4tuples; index-assign/range rejectedtests/tuples, tests/tuple_assign, reject/tuple_elem_index_assign, reject/tuple_index_range
    §17.5destructuring; simultaneous assignment; swizzlingtests/multiassign_scope, tests/tuple_assign, tests/multi_assign, tests/swizzle, tests/lane_names, reject/lane_past_end, reject/lane_too_many, reject/massign_dup_target, reject/massign_not_a_place, reject/massign_for_clause, reject/swizzle_dup_field, reject/swizzle_one_component, reject/swizzle_base_not_place, reject/swizzle_base_indexed, reject/massign_subscript_target
    §18.2–18.6m[k] place/rvalue, delete, keys, m.gettests/map_mutation, tests/map_delete, tests/map_get_method, tests/map_insorder, reject/map_del_removed, reject/map_key_wrong_read
    §18.7user-defined subscriptstests/subscript
    §19.1–19.3enums, Option, Result; constructiontests/enums, tests/options, tests/results, reject/genenum_bare_nullary, reject/sum_ctor_payload_mismatch
    §14.1.1pass, the no-op statement; contextual, so the name still bindstests/pass_stmt, reject/pass_as_value
    §28.3a top-level const is exported and folded at the use site; _name stays privatetests/pkg/const_export, reject/pkg/const_private
    §15main's two shapes; Err out of the entry point prints bare and exits non-zerotests/main_result, tests/abort/main_result_err, reject/main_result_int, reject/main_result_enum_err, reject/main_params
    §19.8, §13.2is — the variant test: nullary and payload-carrying alike, inside a boolean expression, and the two compile-time rejectionstests/enum_is, reject/enum_is_unknown_variant, reject/enum_is_not_an_enum
    §19.8, §19.5, §19.6is on Option and Result: all four names, on a call result, and a name from the other family rejectedtests/optres_is, reject/optres_is_wrong_family
    §19.xor_return propagationtests/or_return, tests/or_return_option, tests/or_return_frees
    §5.3.6Result(void, E): Ok(), a bare Ok: arm, the or_return statement formtests/result_void, reject/void_not_a_type, reject/option_void, reject/result_void_err, reject/result_void_ok_arg, reject/ok_empty_nonvoid, reject/err_empty, reject/result_void_bind, reject/result_void_arm_binds, reject/match_result_void_missing_err, reject/orreturn_stmt_value

    §21–26 Concurrency & FFI

    ClauseRequirement (abbrev.)Fixture(s)
    §21spawn / Task / wait (affine, implicit join)tests/conc/basic, tests/conc/implicit, reject/task_copy
    §22parallel-for (0..<N counting form and foreach); channel-draintests/conc/parfor, tests/conc/parfor_dotlt, tests/conc/parfor_chan, tests/conc/select_parfor, parforparity lane
    §23channels (Vyukov, capacity, select)tests/conc/chan, tests/conc/chancap1, tests/conc/select, reject/send_wrong_type, reject/chan_reassign
    §24.1FFI crossable types (scalars/str/bytes/handles/sized)tests/ffi, examples/sqlite/demo.ty
    §24.1[string] param crosses as (const char *const *, long), borrowed; empty arraytests/ffi (ffi_sfold, ffi_spick)
    §24.1a [string] *return* stays rejectedtests/reject/extern_ret_arr_string.ty
    §24.2linking / cc invocationtests/ffi/run.sh, examples/sqlite
    §25typed handle decl: name must not collide with a struct/enum/newtype/handletests/reject/handle_dup_name

    §27–28 Program & packages

    ClauseRequirement (abbrev.)Fixture(s)
    §27.1entry point main; missing rejectedtests/reject/no_main, tests/early_return_main
    §28.1–28.5packages, import, multi-file mergetests/pkg/multifile, tests/pkg/alias, tests/pkg/variant, tests/pkg/shapes
    §28.3visibility / privacytests/pkg/privacy

    §29–30 Builtins & runtime

    ClauseRequirement (abbrev.)Fixture(s)
    §29.3I/O & process builtinstests/io_builtins, tests/println, tests/write_file
    §29.5string builtinstests/strbuild, tests/str_fuse, tests/str_index, tests/strbytes
    §29.5char_at yields char; s[i] still yields int; OOB abortstests/char_at, tests/abort/char_at_oob, reject/char_at_arg_index_type, reject/char_at_arg_recv_type
    §29.6array builtins; len on scalar rejectedtests/pop, tests/reservecomposite, reject/len_scalar
    §29.12abnormal termination (die)tests/die
    §29.12exit(code) terminates with an explicit status (0 included)server/main.ty (--help); no tests/ fixture
    §29.12.1die/exit are diverging: legal as a value if/match tail; all-diverging rejectedserver/main.ty (srv := match net.listen(...)); no tests/ fixture
    §30.1defined two's-complement wraparoundtests/int_overflow
    §30.2the abort set (div0, bounds, empty pop, …)tests/abort/div_zero, abort/div_overflow, abort/mod_zero, abort/index_oob, abort/chr_oob, abort/pop_empty, abort/reserve_range
    §30.4defined string/map behavior (byte-safe, insertion order)tests/string_nul, tests/map_insorder, tests/maparraykey

    E.2.1 Clauses without a dedicated fixture (flagged)

    These are covered by construction or by design rather than a single fixture, and are flagged here so the gap is explicit rather than hidden:

    The deps-tier corelib clauses (§31–33, the http/crypto/compress/image/ tls packages) map to corelib/test/<pkg> and are extended-tier only.

    E.3 The make spec-check gate

    make spec-check (scripts/spec_check.sh) asserts that every fixture cited in E.2 exists, and builds and runs every runnable example in the spec against its shown output.