Skip to content

Autoharness umbrella: generic function with no candidate type (GenericFn) #4888

Description

@CYJ904

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:

  1. Const generic parameter Kani can't pick a value for (non-usize, or a const {} block constraint)
  2. Generic function with no candidate type
  3. No function body
  4. Missing Arbitrary
  5. Requires bounded arguments

If Kani reports GenericFn with a "no candidate type" message, the function belongs here.

Common cases that belong here

  1. Functions bounded by traits that none of the candidate types implement, for example closure bounds like F: FnMut(...) or allocator bounds like A: Allocator.
  2. Functions with several type parameters whose bounds can't be satisfied together by the candidates.
  3. 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

  1. A generic function that was instantiated (reported with a name like foo::<i32>) but is skipped with MissingArbitraryImpl: Missing Arbitrary umbrella, Autoharness umbrella: Missing Arbitrary (MissingArbitraryImpl) #4887.
  2. A GenericFn skip 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

  1. added this to the Autoharness milestone on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Z-AutoharnessIssue related to autoharness subcommand

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions