Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unreachable code: Failed to find trait impl during monomorphization #5017

Open
jfecher opened this issue May 10, 2024 · 0 comments
Open

unreachable code: Failed to find trait impl during monomorphization #5017

jfecher opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jfecher
Copy link
Contributor

jfecher commented May 10, 2024

Aim

use dep::std::collections::map::HashMap;
use dep::std::hash::poseidon2::Poseidon2Hasher;
use dep::std::hash::BuildHasherDefault;

global MAP: HashMap<Field, Field, 2, Poseidon2Hasher> = {
    let mut map = HashMap::default();
    map.insert(1, 2);
    map.insert(3, 4);
    map
};

fn main() {
    println(MAP);
}

Expected Behavior

The compiler to error that there is no impl BuildHasher for Poseidon2Hasher. The correct type would be BuildHasherDefault<Poseidon2Hasher>

Bug

The application panicked (crashed).
Message:  internal error: entered unreachable code: Failed to find trait impl during monomorphization. The failed constraint(s) are:
  Poseidon2Hasher: BuildHasher<H'304 -> '22670>
Location: compiler/noirc_frontend/src/monomorphization/mod.rs:1060

To Reproduce

Project Impact

None

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

None

Nargo Version

No response

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@jfecher jfecher added the bug Something isn't working label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant