Skip to content

Feature request: Support trait implementations in --start-from #956

@oliver-butterley

Description

@oliver-butterley

Problem

--start-from only supports simple path syntax and cannot handle trait implementations. The path parsing at translate_crate.rs:628 uses a naive :: split:

let path = path.split("::").collect_vec();

This breaks when specifying trait implementations like:

curve25519_dalek::backend::serial::curve_models::{core::clone::Clone for curve25519_dalek::backend::serial::curve_models::ProjectivePoint}

It seems that the {impl ...} syntax that works with --include, --opaque, and --exclude (which use the NamePattern parser) doesn't work with --start-from.

Desired Behaviour

--start-from should accept the same name-matcher syntax as --include/--opaque/--exclude, including:

  • Trait implementations: {impl Trait for Type}
  • Trait methods: {impl Trait for Type}::method

It would also be convenient, but less important, if --start-from accepts generic patterns (_ / *).

Use Case

When verifying specific functions in a large crate, I want to extract only specific trait implementations and their dependencies, without pulling in unrelated code that causes extraction errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions