rust-fuzz / rust-fuzz/arbitrary

bound attribute doesn't work with associated type bounds

Open
#213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
880
Forks
93
PR merge metrics
No merged PRs in 30d

Description

Minimal example:

use arbitrary::Arbitrary;

pub trait Bar {
    type Value;
}

#[derive(Arbitrary)]
#[arbitrary(bound = "T::Value: Arbitrary")]
pub struct Foo<T: Bar>(T::Value);

Error output:

error: expected identifier
 --> src/lib.rs:8:21
  |
8 | #[arbitrary(bound = "T::Value: Arbitrary")]
  |                     ^^^^^^^^^^^^^^^^^^^^^

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the #[derive(Arbitrary)] implementation and the parsing of the arbitrary(bound = ...) attribute shown in the minimal example. Reproduce the compiler error, then verify that the example compiles with the associated type bound and that existing bound syntax remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.