Skip to content

Default trait is not implemented for rodeo with spur types other than Spur #26

@lo48576

Description

@lo48576

I tried this code

#[derive(Default)]
struct Foo {
    strings: Rodeo<lasso::MiniSpur>,
}

I expected this to happen

The code compiles.

Instead this happened

This does not compile.
Compiler says error[E0277]: the trait bound `lasso::Rodeo<lasso::MiniSpur>: std::default::Default` is not satisfied.

Meta

Lasso version: 0.5.0

Rustc version: 1.52.0

> rustc -Vv
rustc 1.52.0 (88f19c6da 2021-05-03)
binary: rustc
commit-hash: 88f19c6dab716c6281af7602e30f413e809c5974
commit-date: 2021-05-03
host: x86_64-unknown-linux-gnu
release: 1.52.0
LLVM version: 12.0.0

Additional context

impl Default for Rodeo<Spur, RandomState> redirects to Self::new(), and Self::new() is implemented for any Rodeo<K, RandomState> where K: Key.
Is there any reason not to implement impl<K: Key> Default for Rodeo<K, RandomState>?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions