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
ICE: s.find(needle, from) on a str reaches MIR with no declared signature (BUG, exit 134) instead of a diagnostic #2358
Spec §15 (strings); D65 (Sema resolves the call, MIR never re-derives it); "No silent fallbacks" (fail loudly with a diagnostic, never an ICE).
Repro (installed compiler, main a31a7df52):
fn main:
let s = "abcabc"
print(s.find("b", 2))
Actual: BUG: builtin method \find` argument 1 reached MIR with no declared signature (Sema resolves the BuiltinSigs ro…and exit 134 (abort). Expected: either the two-argument form exists (a start offset is the natural second argument, asrfind/index_of users keep wanting) or a diagnostic at the call: "find` takes one argument".
Found while a With tool script used s.find(block, first + 1); the crash made the script's edit silently not happen (the build then ran on unchanged sources). A check-time refusal would have stopped at the right place.
Activity
#2358: Sema refuses a builtin call whose argument count is outside it…
#2366: an assignment makes the new value before freeing the old; #2377 …