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

[stdlib] Introduce Hasher type with all necessary changes #2619

Draft
wants to merge 1 commit into
base: nightly
Choose a base branch
from

Conversation

mzaks
Copy link
Contributor

@mzaks mzaks commented May 11, 2024

This is a draft because although the code compiles 8 tests are failing.
It might be due to compiler bug. The error messages are cryptic. I don't have the "Mojo" ;) to fix them.

Failed Tests (8):
Mojo Standard Library :: builtin/test_dtype.mojo
Mojo Standard Library :: builtin/test_hash.mojo
Mojo Standard Library :: builtin/test_object.mojo
Mojo Standard Library :: builtin/test_string.mojo
Mojo Standard Library :: builtin/test_string_literal.mojo
Mojo Standard Library :: collections/test_dict.mojo
Mojo Standard Library :: collections/test_set.mojo
Mojo Standard Library :: python/test_python_object.mojo

Failed Tests (8):
  Mojo Standard Library :: builtin/test_dtype.mojo
  Mojo Standard Library :: builtin/test_hash.mojo
  Mojo Standard Library :: builtin/test_object.mojo
  Mojo Standard Library :: builtin/test_string.mojo
  Mojo Standard Library :: builtin/test_string_literal.mojo
  Mojo Standard Library :: collections/test_dict.mojo
  Mojo Standard Library :: collections/test_set.mojo
  Mojo Standard Library :: python/test_python_object.mojo

Signed-off-by: Maxim Zaks <[email protected]>
@mzaks
Copy link
Contributor Author

mzaks commented May 12, 2024

@mzaks
Copy link
Contributor Author

mzaks commented May 17, 2024

@JoeLoser do we have a status on this one? From what I can tell there are some unexpected deeper language problems, my guess is it has something to do with register passable types. I am ok with shelving it for now. If so, I will concentrate on some other things and revisit when it is resolvable.

@mzaks
Copy link
Contributor Author

mzaks commented May 17, 2024

Actually now I rebased the minimal reproducible example mzaks:feature/minimal-example-of-test-crash-for-new-hasher and it some times passes and some times fails the test. Seems like the order of tests is important and there is something fishy going on.

@mzaks
Copy link
Contributor Author

mzaks commented May 20, 2024

After rebasing the mzaks:feature/minimal-example-of-test-crash-for-new-hasher on todays nightly, I see following compile error on :

invalid indirect call: l-value of type '$0' cannot be converted to reference of type 'H'
struct Int(
       ^~~

The H in question is from:

trait NewHashable:
    fn __hash_with__[H: Hasher](self, inout hasher: H):
        pass

which Int is implementing.

I pushed the rebased version so the team can confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant