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
Autoharness: support &Formatter and &mut Formatter arguments under --bounded-arguments #4823
Requested feature: autoharness support for &Formatter and &mut Formatter arguments under --bounded-arguments.
Use case: on a whole-library verify-std run, 184 functions are skipped only for a Formatter reference argument (156 in core, 21 in compiler_builtins, 5 in alloc, 2 in std): Formatter's own methods (pad, pad_integral, debug_struct, write_str and the rest), the fmt methods of Binary, Octal, LowerHex, UpperHex, LowerExp, UpperExp and Pointer, which the Debug/Display handling from #4701 does not cover, and helpers that take a Formatter, such as Duration's fmt_decimal and Ipv6Addr's fmt_subslice.
use std::fmt::{self,Formatter};// Skipped: "Missing Arbitrary implementation for argument(s) f: &mut std::fmt::Formatter<'_>".// Expected: "Requires --bounded-arguments" without the flag; a harness once it is passed.pubfnpad(f:&mutFormatter<'_>) -> fmt::Result{
f.pad("ab")}
Formatter::new(&mut dyn Write, FormattingOptions) and the FormattingOptions builders are public under formatting_options, and kani_core already has a sink that discards its output for the fmt-trait models. A model can build a Formatter over a harness-local sink with every option nondeterministic: width and precision unset or up to the slice bound, since they drive the padding loops; fill, alignment, sign, the alternate and zero-padding flags, and debug hex mode unrestricted. Every combination is a valid Formatter, so no value is excluded. The one limit is the sink, which never fails, so paths that handle a write error are not reached. &mut has to be admitted for this type, since fmt methods take it mutably. The kani crate would enable formatting_options.
Activity
Autoharness: support `&Formatter` and `&mut Formatter` arguments unde…