You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the error is extremely confusing (and doesn't get any better if you split the code apart into multiple lines and add type annotations):
equals.rs:13:36: 13:39 error: mismatched types: expected `&const <V41>` but found `'a` (expected &-ptr but found type parameter)
equals.rs:13 vec::find(self, |e| {e.first() == key}).is_some()
^~~
equals.rs:13:23: 13:39 error: cannot determine a type for this bounded type parameter: unconstrained type
equals.rs:13 vec::find(self, |e| {e.first() == key}).is_some()
^~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
That's quite a bit better: at least it points you to the operator having problems. My understanding is that it is an error because arbitrary generic types cannot be equated. You need to constrain them with the Eq trait which the code above does not do.
directly call handle_alloc_error
Also test more codepaths. There's like 5 different things that can happen on allocation failure! Between `-Zoom`, `#[alloc_error_handler]`, and `set_alloc_error_hook`, we have 3 layers of behavior overrides. It's all a bit messy.
rust-lang#112331 seems intended to clean this up, but has not yet reached consensus.
The following code is missing a cmp::Eq type constraint:
But the error is extremely confusing (and doesn't get any better if you split the code apart into multiple lines and add type annotations):
The text was updated successfully, but these errors were encountered: