You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27o: std table gaps found on compiler.rs (is_ascii_*, chars().all, find, max, trim_start_matches, strip_prefix, let-bound receivers, matches! on a call) #9100
Part of the t27o epic (see #8998). Found by the dogfood run of tri t27o on bootstrap/src/compiler.rs (see #9090, see #9093).
Std calls that are missing from the table in specs/tools/t27o/rust_std.t27 refuse 11 of the 77 primitive-argument helpers of compiler.rs, each run alone. Over the whole file, they refuse 18 fns, plus 4 for matches!.
Note on starts_with. It is in the table. It is refused here because the receiver is a local bound to a std call's result (let v = s.trim();), and the receiver's class is not carried through the let. match s.trim() { .. } converts, and matches!(s.trim(), ..) does not.
User Scenarios
Given fn is_ident_byte(b: u8) -> bool { b.is_ascii_alphanumeric() || b == b'_' }, when tri t27o --check runs on it, then it converts and its oracle passes, through tri::t27b::type_text's word / alpha / digit where they have the same I/O (DRY).
Given let v = s.trim(); if v.starts_with("0x") { .. }, when t27o converts it, then v is known to be a text, and starts_with maps as it does on a parameter.
Given matches!(ty.trim(), "u8" | "u16"), when t27o converts it, then it lowers like match ty.trim().
Requirements
FR-001: rust_std.t27 MUST map u8 is_ascii_alphanumeric, is_ascii_alphabetic, is_ascii_digit, integer max / min, text find (char or text needle, as ?usize), trim_start_matches / trim_end_matches of a char, strip_prefix / strip_suffix (as ?[]const u8), and chars().all(<one ASCII class test>). Each entry MUST name existing t27 when one has the same I/O, and MUST have rustc-printed vectors like the existing entries.
FR-002: rust_convert.t27 MUST carry the receiver class through let x = <std call>; when the call's result class is known.
FR-003: matches! MUST accept any scrutinee that match accepts.
Success Criteria
tri t27o bootstrap/src/compiler.rs | grep -cE 'method .(is_ascii_alphanumeric|is_ascii_alphabetic|chars|find|max|trim_start_matches|strip_prefix|starts_with). at' prints 0 (17 at master ea1bccd).
tri t27o bootstrap/src/compiler.rs | grep -c 'macro .matches. at' prints 0 (4 at master ea1bccd).
t27c test-report specs/tools/t27o/rust_std.t27 passes with a test per new entry, 0 vacuous.
Activity
t27o: self-less associated fns, while-let/if-let-Err/tuple patterns, …