Skip to content

Instantly share code, notes, and snippets.

@gcoakes
Created April 15, 2022 23:31
Show Gist options
  • Save gcoakes/9c8b26870f7099ddc92bd5af96676fda to your computer and use it in GitHub Desktop.
Save gcoakes/9c8b26870f7099ddc92bd5af96676fda to your computer and use it in GitHub Desktop.
❯ cargo check --workspace
Checking cohort-crdt v0.1.0 (/home/gcoakes/src/cohort/crates/crdt)
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
--> crates/crdt/src/gcounter.rs:78:14
|
78 | self.count() == other.count()
| ^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
--> crates/crdt/src/gcounter.rs:77:11
|
77 | fn eq(&self, other: &Self) -> bool {
| ^^^^^
note: ...so that reference does not outlive borrowed content
--> crates/crdt/src/gcounter.rs:78:9
|
78 | self.count() == other.count()
| ^^^^
note: but, the lifetime must be valid for the lifetime `'a` as defined here...
--> crates/crdt/src/gcounter.rs:72:6
|
72 | impl<'a, K, V> PartialEq for GCounter<K, V>
| ^^
note: ...so that the types are compatible
--> crates/crdt/src/gcounter.rs:78:14
|
78 | self.count() == other.count()
| ^^^^^
= note: expected `Sum<&V>`
found `Sum<&'a V>`
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
--> crates/crdt/src/gcounter.rs:78:31
|
78 | self.count() == other.count()
| ^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
--> crates/crdt/src/gcounter.rs:77:25
|
77 | fn eq(&self, other: &Self) -> bool {
| ^^^^^
note: ...so that reference does not outlive borrowed content
--> crates/crdt/src/gcounter.rs:78:25
|
78 | self.count() == other.count()
| ^^^^^
note: but, the lifetime must be valid for the lifetime `'a` as defined here...
--> crates/crdt/src/gcounter.rs:72:6
|
72 | impl<'a, K, V> PartialEq for GCounter<K, V>
| ^^
note: ...so that the types are compatible
--> crates/crdt/src/gcounter.rs:78:31
|
78 | self.count() == other.count()
| ^^^^^
= note: expected `Sum<&V>`
found `Sum<&'a V>`
For more information about this error, try `rustc --explain E0495`.
error: could not compile `cohort-crdt` due to 2 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment