-
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
Confusing error when checking trait impl against trait #890
Comments
The check is not implemented at all when strong references are involved so it just crashes. Do you need the &strg? isn't the mut ref unfolding we implemented enough for this use case? I would like to know why not. In any case, @ranjitjhala maybe you can take care of finishing the work on trait impl checking to consider strong references. @enjhnsn2 in the mean time you can use |
As requested, another implementation #[flux_rs::sig(
fn(self: &strg RingBuffer<T>[@old]) ensures self: RingBuffer<T>[old.ring_len, 0, 0]
)]
fn empty(&mut self) {
self.head = 0;
self.tail = 0;
} and trait method /// Remove all elements from the ring buffer.
fn empty(&mut self); where the implementation has a non-trivial |
@ranjitjhala your PR doesn't consider this case. We need the Also, I always thought that if you have an |
on it! |
I updated the PR to handle the above (I think!) can you lmk if it works now @enjhnsn2 (and of course reopen if not!) |
When I try to check the following trait implementation (here):
against the trait spec (here):
it fails with the error:
I'm a little confused because the spec is token-for-token identical in both the trait and implementation, and only asserts that we need a
&strg Self
.I also get a similar error when there is no spec on the trait at all. I don't fully understand the implementation for trait_impl checking, so I'm not sure if this is expected or not.
Any guidance?
The text was updated successfully, but these errors were encountered: