TimelyDataflow / TimelyDataflow/differential-dataflow

Cryptic error messages when working with custom types

Open
#228 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3k
Forks
211
Avg merge
10h 42m
Merged PRs (30d)
34

Description

Hi,

This is just a usability hint. I am trying to work with custom structs in differential dataflow and I spent some hours figuring out why I cannot invoke count on collections using my struct. It turned out I just forgot implement Hashable but the error message during compilation makes it very hard to arrive at that insight:

error[E0599]: no method named `count` found for type `differential::itembased::differential_dataflow::Collection<differential::itembased::timely::dataflow::scopes::Child<'_, differential::itembased::timely::worker::Worker<differential::itembased::timely::communication::Allocator>, T>, differential::lsh::Sample>` in the current scope
  --> src/differential/lsh.rs:74:14
   |
74 |             .count()
   |              ^^^^^ method not found in `differential::itembased::differential_dataflow::Collection<differential::itembased::timely::dataflow::scopes::Child<'_, differential::itembased::timely::worker::Worker<differential::itembased::timely::communication::Allocator>, T>, differential::lsh::Sample>`
   |
   = note: the method `count` exists but the following trait bounds were not satisfied:
           `&mut differential::itembased::differential_dataflow::Collection<differential::itembased::timely::dataflow::scopes::Child<'_, differential::itembased::timely::worker::Worker<differential::itembased::timely::communication::Allocator>, T>, differential::lsh::Sample> : std::iter::Iterator`
           `differential::itembased::differential_dataflow::Collection<differential::itembased::timely::dataflow::scopes::Child<'_, differential::itembased::timely::worker::Worker<differential::itembased::timely::communication::Allocator>, T>, differential::lsh::Sample> : differential::itembased::differential_dataflow::operators::Count<_, _, _>`

warning: unused import: `self::differential_dataflow::operators::Count`
  --> src/differential/lsh.rs:17:5
   |
17 | use self::differential_dataflow::operators::Count;

Contributor guide

Open the contributing guide

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

Reproduce the custom-struct example described in the issue, starting with src/differential/lsh.rs around lines 17 and 74. Trace the Count operator's trait bounds and compare the compiler output with the missing Hashable implementation. Done means the failure points a user toward the required trait instead of reporting only that count is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.