Repository navigation
Description
This umbrella tracks generic functions that autoharness skips because it cannot find a concrete type to instantiate them with. It is one of five skip-reason umbrellas indexed in #4879.
What this category means
Autoharness can only generate a harness for a concrete function. For a generic function, Kani searches a list of candidate types (such as i32, u32, and others) for one that satisfies the function's trait bounds (#4679, #4706). If no candidate satisfies the bounds, the function is skipped with the reason GenericFn, and the message says that no candidate type satisfies the bounds.
The search stops after 256 trait-solver queries. If it hits that limit, Kani reports the same message, so "no candidate type" does not always mean that no suitable type exists. #4877 tracks making the message distinguish these causes.
Classification rule
We classify by the skip reason Kani reports, not by the underlying cause. Kani reports only one reason per function: the first check that fails, in this order:
- Const generic parameter Kani can't pick a value for (non-usize, or a
const {}block constraint) - Generic function with no candidate type
- No function body
- Missing
Arbitrary - Requires bounded arguments
If Kani reports GenericFn with a "no candidate type" message, the function belongs here.
Common cases that belong here
- Functions bounded by traits that none of the candidate types implement, for example closure bounds like
F: FnMut(...)or allocator bounds likeA: Allocator. - Functions with several type parameters whose bounds can't be satisfied together by the candidates.
- Functions where the search hit the 256-query limit.
Because this check runs early, a function reported here may also have other problems (no body, missing Arbitrary, bounded arguments) that Kani doesn't report yet.
Cases that belong elsewhere
- A generic function that was instantiated (reported with a name like
foo::<i32>) but is skipped withMissingArbitraryImpl: Missing Arbitrary umbrella, Autoharness umbrella: Missing Arbitrary (MissingArbitraryImpl) #4887. - A
GenericFnskip whose message is about const generic parameters: Autoharness umbrella: non-usize const generic parameters (GenericFn) #4889.
All umbrellas are listed in #4879.
How to check
Run autoharness on your crate (cargo kani autoharness -Z autoharness), or in verify-rust-std run kani autoharness -Z autoharness --std ./library with the flags your setup uses. Kani prints a table of skipped functions with their reasons before the list of harnesses. Don't pass --quiet, which suppresses that table. Check that the reason is GenericFn and the message says no candidate type was found.
How to link
Add Part of #<this issue> to your issue or PR description so it shows up here.
Activity