Requested feature: autoharness support for &Wtf8 arguments under --bounded-arguments, beside &str, &CStr (#4803) and &ByteStr (#4805).
Use case: on a whole-library verify-std run, 32 functions in core are skipped for a missing Arbitrary implementation on a &Wtf8 argument: the wtf8::Wtf8 methods (len, as_str, code_points, encode_wide, next_surrogate and the rest) and its trait implementations (PartialEq, Ord, Hash, Debug, Display, the range Indexes).
Link to relevant documentation (Rust reference, Nomicon, RFC): https://simonsapin.github.io/wtf-8/ (the encoding). The type is core::wtf8::Wtf8, #[doc(hidden)] and gated on wtf8_internals, the representation behind OsStr on Windows.
Test case:
#![feature(wtf8_internals)]
#![allow(internal_features)]
use core::wtf8::Wtf8;
// Skipped: "Missing Arbitrary implementation for argument(s) s: &core::wtf8::Wtf8".
// Expected: "Requires --bounded-arguments" without the flag; a harness once it is
// passed, and this one fails on the empty string.
pub fn first(s: &Wtf8) -> u8 {
s.as_bytes()[0]
}
WTF-8 is a superset of UTF-8, so the existing bounded string model gives a sound value: Wtf8::from_str over any_str_ref, with the string bound. That leaves out strings holding surrogate code points, the case WTF-8 exists for; generating those needs a WTF-8 validator that core does not expose. Whether an internal, doc(hidden) type is worth a model is the question here; the kani crate would enable wtf8_internals to name it.
Requested feature: autoharness support for
&Wtf8arguments under--bounded-arguments, beside&str,&CStr(#4803) and&ByteStr(#4805).Use case: on a whole-library
verify-stdrun, 32 functions incoreare skipped for a missing Arbitrary implementation on a&Wtf8argument: thewtf8::Wtf8methods (len,as_str,code_points,encode_wide,next_surrogateand the rest) and its trait implementations (PartialEq,Ord,Hash,Debug,Display, the rangeIndexes).Link to relevant documentation (Rust reference, Nomicon, RFC): https://simonsapin.github.io/wtf-8/ (the encoding). The type is
core::wtf8::Wtf8,#[doc(hidden)]and gated onwtf8_internals, the representation behindOsStron Windows.Test case:
WTF-8 is a superset of UTF-8, so the existing bounded string model gives a sound value:
Wtf8::from_stroverany_str_ref, with the string bound. That leaves out strings holding surrogate code points, the case WTF-8 exists for; generating those needs a WTF-8 validator thatcoredoes not expose. Whether an internal,doc(hidden)type is worth a model is the question here; thekanicrate would enablewtf8_internalsto name it.