-
Notifications
You must be signed in to change notification settings - Fork 23
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
Frontend: panic on default traits parameters #310
Comments
This is still the case, with: error[E9999]: Cannot handle error `Unimplemented` selecting `Binder { value: <Self as Foo>, bound_vars: [] }`
--> literals/src/lib.rs:4:1
|
4 | trait Bar<T = <Self as Foo>::U> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ⚠️ This is a bug in Hax's frontend.
Please report this error to https://github.com/hacspec/hax/issues with some context (e.g. the current crate)! |
This was silenced as a warning by PR #898, but this is still an issue. |
Rustc always gives us the right parameters when referring to a trait, right? Can we ignore the default parameters entirely? |
Ah, that's true, you're right, we don't do anything with this information, and rust always inline parameters at use site. So dropping default parameters would be an easy fix! I guess I can push a PR that disables that with a comment: in an ideal world I'd like that info to be exported since we "have" it, but we don't have unlimited time 😅 |
This PR disable default parameters on traits, both in the engine and in the exporter, following the conversation in #310. Explanation (quoting my comment in code): > On use site, Rust always give us all the generic > parameters, no matter the defaultness. This information is > thus not so useful. At the same time, as discussed in > #310, extracting this > default type causes failures when querying Rust for trait > resolution. We thus decided to disable this feature. If > this default type information is useful to you, please > open an issue on https://github.com/hacspec/hax. Fixes #310
The following piece of code:
Open this code snippet in the playground
Yields a panic in the frontend.
The text was updated successfully, but these errors were encountered: