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
D100: std's unchecked helpers become unsafe fn #2208
D100 (spec v7.27): "an unchecked helper should also be an unsafe fn, so even code inside std has to acknowledge the risk when calling it". Privacy now keeps user code out (package-wide visibility); this is the second guard, inside std.
Survey (non-pub std functions whose safety rests on what the caller passes: a raw pointer, a length, an unchecked index):
regex.w helpers over a raw pcre2 code pointer (regex_match_data, regex_pattern_info, regex_match_spans_at, regex_group_index, regex_substitute*, …)
Each either becomes unsafe fn (callers in std wrap the call in unsafe) or checks its own inputs and stays safe. Drop/deref impls that encapsulate their unsafe are out of scope.
Done already (e09e29d8d, on branch method-privacy): the HashMap slot accessors (slot_key/slot_value/slot_take) are checked in both backends and panic on a dead slot. BTreeMap.key_at (#2186's segfault) is a bounds-checked indexed read on main.
Activity
std: the unchecked helpers are unsafe fn, and std acknowledges the ri…
check: an unsafe call in an uninstantiated generic body is refused at…
c_import facade over an omitted function (#2244); unsafe calls in gen…