Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .trinity/seals/t27o_T27oRust.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
"built_by": "t27c-bootstrap@0.5.2+ea35d9b72",
"closure": [],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:08df0e325d4acb3d37cda78c58f0752a3454fdd64190e33bd7719233129e986a",
"gen_hash_rust": "sha256:ae90e0046b61cf596e6114e14c62abeaed343a834d5131d981058727a54ba933",
"gen_hash_verilog": "sha256:e0f53958647f52ef5b82d57d3553e4bada519d5ce98e78a861d2cbb74bcf1d49",
"gen_hash_zig": "sha256:1d85bad0405fe228eae8ad363edb6fb76b26e9ee87cf7aa0fadac43c49483f4a",
"gen_hash_c": "sha256:ba1f66e21d989982d79ee41c7913ef3937b1a716632e1650c0f552ce56044ff5",
"gen_hash_rust": "sha256:a2cad2a0e3bb75c1df629d761d91debbe7ca34c1bf2a9ed6e720928ff2ced311",
"gen_hash_verilog": "sha256:dfc8a0c23a672fea3f010c7a6a4fa0790565f15d74d245d8824214f53e4595af",
"gen_hash_zig": "sha256:7736f857fb377c908dd4f0dfdd20aeea04ffb6024ce384a19a59a2b5c8bc5770",
"module": "T27oRust",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T02:57:39Z",
"sealed_at": "2026-10-19T03:25:15Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:11f3aefa0a152d9ca963773018e35b1e39730ac53b25604be67252aaf85522a3",
"spec_hash": "sha256:a0e477ab019f977b889abd108fb797fa82dde39c4d0d594e33e4c86b38fbe935",
"spec_path": "specs/tools/t27o/rust_convert.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 128,
"total": 128,
"passed": 129,
"total": 129,
"vacuous": 0
},
"toolchain": {
Expand Down
16 changes: 8 additions & 8 deletions .trinity/seals/t27o_T27oRustStd.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:cef0604f716d2aa7f0a21b5dabb8af9eac42cfd7528bf0aaf5c140fd00723739",
"gen_hash_rust": "sha256:fa9767acc5685bdce7cd03f7d542545c60e718a44f4b75533aac9856dcf2234d",
"gen_hash_verilog": "sha256:6ce3da44fac0d82bcc12c8c522641b21edd45b0ed84abcfc65fb2321bf0b8557",
"gen_hash_zig": "sha256:3a854380824358f5e294a1c9a0e180717706e4b0f89be2b65635b9443b56326e",
"gen_hash_c": "sha256:fe7f38f1687785370d91298f1842a21ae88826238310fafd04bc72e2592c5e6b",
"gen_hash_rust": "sha256:9ddea23180c0817a0c5e97a5a84106175769924cfbd397e658360fdff92302d9",
"gen_hash_verilog": "sha256:1c3f8556c8c801f4201e21b9a593422617eec02069c917cb423ccfa67cf08d2a",
"gen_hash_zig": "sha256:eac278d99fb6df3a70c3f3b5a894ce0347048da5e6f13778b4cc8a4f69c12f16",
"module": "T27oRustStd",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T02:57:25Z",
"sealed_at": "2026-10-19T03:25:06Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:66a569db8a5e54879d6958aa47e96942e80615d5d5ac5a9b03b8a6222da6e024",
"spec_hash": "sha256:e72606b4b3d7611883db25ed9fdaecb4353fe6a1fef551500b3cd1cc18cceb79",
"spec_path": "specs/tools/t27o/rust_std.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 61,
"total": 61,
"passed": 51,
"total": 51,
"vacuous": 0
},
"toolchain": {
Expand Down
35 changes: 24 additions & 11 deletions gen/rust/tools/t27o/rust_convert.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Generated from .t27 spec
// DO NOT EDIT — generated by t27c
// NOT LOWERED BY THIS BACKEND: 128 test(s), 0 invariant(s), 0 function(s) with no body.
// NOT LOWERED BY THIS BACKEND: 129 test(s), 0 invariant(s), 0 function(s) with no body.
// This backend emits declarations only. The spec's checks live in
// the Zig and Verilog outputs; do not read this file as verified.

Expand Down Expand Up @@ -302,6 +302,8 @@ pub const R_VECTYPE: usize = 36;

pub const R_LIBM: usize = 37;

pub const R_SLICEGEN: usize = 38;

pub const VU_READ: usize = 0;

pub const VU_CHANGED: usize = 1;
Expand Down Expand Up @@ -3419,19 +3421,19 @@ pub const STD_MODS: [&'static str; 5] = ["", "tools::t27o::rust_std", "hosting::

pub const MOD_TTEXT: u8 = 4;

pub const STD_N: usize = 75;
pub const STD_N: usize = 74;

pub const STD_NAME: [&'static str; 75] = ["len", "is_empty", "as_bytes", "as_str", "as_slice", "clone", "abs", "abs", "min", "max", "cmp::min", "cmp::max", "wrapping_add", "wrapping_sub", "wrapping_mul", "checked_add", "checked_sub", "checked_mul", "trim", "trim_start", "trim_end", "starts_with", "ends_with", "contains", "contains", "parse", "iter.sum", "iter.count", "unwrap", "expect", "is_some", "is_none", "is_ok", "is_err", "is_ok", "is_err", "ok", "ok_or", "context", "eq", "is_ascii_alphabetic", "is_ascii_alphanumeric", "is_ascii_digit", "chars", "find", "find", "trim_start_matches", "trim_start_matches", "trim_end_matches", "trim_end_matches", "strip_prefix", "strip_prefix", "strip_suffix", "strip_suffix", "starts_with", "count_ones", "leading_zeros", "trailing_zeros", "pow", "saturating_add", "saturating_sub", "saturating_mul", "div_ceil", "sqrt", "is_finite", "to_bits", "is_ascii", "is_ascii", "is_ascii", "to_ascii_lowercase", "to_ascii_uppercase", "get", "contains", "contains.char", "unwrap_or"];
pub const STD_NAME: [&'static str; 74] = ["len", "is_empty", "as_bytes", "as_str", "as_slice", "clone", "abs", "abs", "min", "max", "cmp::min", "cmp::max", "wrapping_add", "wrapping_sub", "wrapping_mul", "checked_add", "checked_sub", "checked_mul", "trim", "trim_start", "trim_end", "starts_with", "ends_with", "contains", "contains", "parse", "iter.sum", "iter.count", "unwrap", "expect", "is_some", "is_none", "is_ok", "is_err", "is_ok", "is_err", "ok", "ok_or", "context", "eq", "is_ascii_alphabetic", "is_ascii_alphanumeric", "is_ascii_digit", "chars", "find", "find", "trim_start_matches", "trim_start_matches", "trim_end_matches", "trim_end_matches", "strip_prefix", "strip_prefix", "strip_suffix", "strip_suffix", "starts_with", "count_ones", "leading_zeros", "trailing_zeros", "pow", "saturating_add", "saturating_sub", "saturating_mul", "div_ceil", "sqrt", "is_finite", "to_bits", "is_ascii", "is_ascii", "is_ascii", "to_ascii_lowercase", "to_ascii_uppercase", "get", "contains.char", "unwrap_or"];

pub const STD_CLASS: [u8; 75] = [0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 3, 4, 4, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, 4, 2, 2, 2, 4, 4, 3, 0];
pub const STD_CLASS: [u8; 74] = [0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 3, 4, 4, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, 4, 2, 2, 2, 4, 3, 0];

pub const STD_ARGS: [u8; 75] = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1];
pub const STD_ARGS: [u8; 74] = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1];

pub const STD_FORM: [&'static str; 75] = ["#.len", "(#.len == 0)", "#", "#", "#", "#", "@abs(#)", "rust_std::abs_%(#)", "@min(#, $)", "@max(#, $)", "@min(#)", "@max(#)", "(# +% $)", "(# -% $)", "(# *% $)", "rust_std::checked_add_%(#, $)", "rust_std::checked_sub_%(#, $)", "rust_std::checked_mul_%(#, $)", "#[type_text::trim_lo(#, 0, #.len) .. type_text::trim_hi(#, type_text::trim_lo(#, 0, #.len), #.len)]", "#[type_text::trim_lo(#, 0, #.len) .. #.len]", "#[0 .. type_text::trim_hi(#, 0, #.len)]", "toolchain::starts_with(#, $)", "toolchain::ends_with(#, $t)", "rust_std::str_contains(#, $t)", "rust_std::bytes_contain(#, $)", "rust_std::parse_%(#)", "rust_std::sum_%(#)", "#.len", "#.?", "#.?", "(# != null)", "(# == null)", "#", "(# == false)", "(# != null)", "(# == null)", "#", "#", "#", "type_text::same(#, $)", "type_text::alpha(#)", "rust_std::alnum(#)", "type_text::digit(#)", "#", "rust_std::find_text(#, $)", "rust_std::find_byte(#, $)", "rust_std::trim_start_matches_text(#, $)", "rust_std::trim_start_matches_byte(#, $)", "rust_std::trim_end_matches_text(#, $)", "rust_std::trim_end_matches_byte(#, $)", "rust_std::strip_prefix_text(#, $)", "rust_std::strip_prefix_byte(#, $)", "rust_std::strip_suffix_text(#, $)", "rust_std::strip_suffix_byte(#, $)", "rust_std::starts_with_byte(#, $)", "rust_std::count_ones_%(#)", "rust_std::leading_zeros_%(#)", "rust_std::trailing_zeros_%(#)", "rust_std::pow_%(#, $)", "rust_std::saturating_add_%(#, $)", "rust_std::saturating_sub_%(#, $)", "rust_std::saturating_mul_%(#, $)", "rust_std::div_ceil_%(#, $)", "@sqrt(#)", "rust_std::is_finite_%(#)", "rust_std::to_bits_%(#)", "rust_std::is_ascii_text(#)", "rust_std::is_ascii_text(#)", "rust_std::is_ascii_%(#)", "rust_std::to_ascii_lowercase_%(#)", "rust_std::to_ascii_uppercase_%(#)", "rust_std::get_%(#, $)", "rust_std::contains_%(#, $)", "rust_std::str_contains_char(#, $)", "if (# != null) { ^.? } else { $ }"];
pub const STD_FORM: [&'static str; 74] = ["#.len", "(#.len == 0)", "#", "#", "#", "#", "@abs(#)", "rust_std::abs_%(#)", "@min(#, $)", "@max(#, $)", "@min(#)", "@max(#)", "(# +% $)", "(# -% $)", "(# *% $)", "rust_std::checked_add_%(#, $)", "rust_std::checked_sub_%(#, $)", "rust_std::checked_mul_%(#, $)", "#[type_text::trim_lo(#, 0, #.len) .. type_text::trim_hi(#, type_text::trim_lo(#, 0, #.len), #.len)]", "#[type_text::trim_lo(#, 0, #.len) .. #.len]", "#[0 .. type_text::trim_hi(#, 0, #.len)]", "toolchain::starts_with(#, $)", "toolchain::ends_with(#, $t)", "rust_std::str_contains(#, $t)", "rust_std::bytes_contain(#, $)", "rust_std::parse_%(#)", "rust_std::sum_%(#)", "#.len", "#.?", "#.?", "(# != null)", "(# == null)", "#", "(# == false)", "(# != null)", "(# == null)", "#", "#", "#", "type_text::same(#, $)", "type_text::alpha(#)", "rust_std::alnum(#)", "type_text::digit(#)", "#", "rust_std::find_text(#, $)", "rust_std::find_byte(#, $)", "rust_std::trim_start_matches_text(#, $)", "rust_std::trim_start_matches_byte(#, $)", "rust_std::trim_end_matches_text(#, $)", "rust_std::trim_end_matches_byte(#, $)", "rust_std::strip_prefix_text(#, $)", "rust_std::strip_prefix_byte(#, $)", "rust_std::strip_suffix_text(#, $)", "rust_std::strip_suffix_byte(#, $)", "rust_std::starts_with_byte(#, $)", "rust_std::count_ones_%(#)", "rust_std::leading_zeros_%(#)", "rust_std::trailing_zeros_%(#)", "rust_std::pow_%(#, $)", "rust_std::saturating_add_%(#, $)", "rust_std::saturating_sub_%(#, $)", "rust_std::saturating_mul_%(#, $)", "rust_std::div_ceil_%(#, $)", "@sqrt(#)", "rust_std::is_finite_%(#)", "rust_std::to_bits_%(#)", "rust_std::is_ascii_text(#)", "rust_std::is_ascii_text(#)", "rust_std::is_ascii_%(#)", "rust_std::to_ascii_lowercase_%(#)", "rust_std::to_ascii_uppercase_%(#)", "rust_std::get_%(#, $)", "rust_std::str_contains_char(#, $)", "if (# != null) { ^.? } else { $ }"];

pub const STD_TYPES: [&'static str; 75] = ["", "", "", "", "", "", "", " i8 i16 i32 i64 ", "", "", "", "", "", "", "", " u32 u64 usize i32 i64 ", " u32 u64 usize i32 i64 ", " u32 u64 usize i32 i64 ", "", "", "", "", "", "", " u8 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u32 u64 usize i32 i64 f32 f64 ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize ", "", " f32 f64 ", " f32 f64 ", "", " u8 ", " u8 ", " u8 ", " u8 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 f32 f64 ", " u16 u32 u64 usize i8 i16 i32 i64 f32 f64 ", "", ""];
pub const STD_TYPES: [&'static str; 74] = ["", "", "", "", "", "", "", " i8 i16 i32 i64 ", "", "", "", "", "", "", "", " u32 u64 usize i32 i64 ", " u32 u64 usize i32 i64 ", " u32 u64 usize i32 i64 ", "", "", "", "", "", "", " u8 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u32 u64 usize i32 i64 f32 f64 ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 ", " u8 u16 u32 u64 usize ", "", " f32 f64 ", " f32 f64 ", "", " u8 ", " u8 ", " u8 ", " u8 ", " u8 u16 u32 u64 usize i8 i16 i32 i64 f32 f64 ", "", ""];

pub const STD_USE: [u8; 75] = [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 4, 4, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0];
pub const STD_USE: [u8; 74] = [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 4, 4, 4, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 1, 4, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0];

pub fn listed(w: &'static str, t: &[u8]) -> bool {
if (t.len() == 0) {
Expand Down Expand Up @@ -3981,6 +3983,10 @@ pub fn method(src: &[u8], st: &mut [usize], out: &mut [u8], start: usize, ra: us
refuse(st, R_LIBM, ka, ka, kb);
return ();
}
if ((word_is(src, na, nb, b"contains") && (cls == C_SLICE)) && listed(" u16 u32 u64 usize i8 i16 i32 i64 f32 f64 ", &src[(tyl) as usize..(tyh) as usize])) {
refuse(st, R_SLICEGEN, ka, tyl, tyh);
return ();
}
refuse(st, R_METHOD, ka, ka, kb);
return ();
}
Expand Down Expand Up @@ -6946,10 +6952,14 @@ pub fn put_reason(src: &[u8], st: &mut [usize], out: &mut [u8]) -> () {
if (c == R_LIBM) {
puts(st, out, b"libm function not bit-exact");
} else {
if (c == R_SPLICE) {
puts(st, out, b"a used module's own use t27c does not splice (its type_text:: names stay unresolved, the gap specs/compiler/int_type_names.t27 records)");
if (c == R_SLICEGEN) {
puts(st, out, b"slice contains on");
} else {
puts(st, out, b"syntax");
if (c == R_SPLICE) {
puts(st, out, b"a used module's own use t27c does not splice (its type_text:: names stay unresolved, the gap specs/compiler/int_type_names.t27 records)");
} else {
puts(st, out, b"syntax");
}
}
}
}
Expand Down Expand Up @@ -6991,6 +7001,9 @@ pub fn put_reason(src: &[u8], st: &mut [usize], out: &mut [u8]) -> () {
puts(st, out, b"` at line ");
let at_line: usize = line_at(src, st, st[(AT) as usize]);
put_num(st, out, at_line);
if (c == R_SLICEGEN) {
puts(st, out, b": no generic helper, and per-type copies are refused by the DRY ratchet");
}
}

pub fn put_refusal(src: &[u8], st: &mut [usize], out: &mut [u8], what: &[u8], na: usize, nb: usize, pos: usize) -> () {
Expand Down
Loading
Loading