Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
  2. --> stack.rs:68:3
  3. |
  4. 68 | Stack { data: v}
  5. | ^^^^^
  6. |
  7. note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 66:2...
  8. --> stack.rs:66:2
  9. |
  10. 66 | / pub fn new_w_vec(v: &mut Vec<f64>) -> Self
  11. 67 | | {
  12. 68 | | Stack { data: v}
  13. 69 | | }
  14. | |__^
  15. note: ...so that reference does not outlive borrowed content
  16. --> stack.rs:68:17
  17. |
  18. 68 | Stack { data: v}
  19. | ^
  20. note: but, the lifetime must be valid for the lifetime 'c as defined on the impl at 10:1...
  21. --> stack.rs:10:1
  22. |
  23. 10 | / impl<'c> Stack<'c>
  24. 11 | | {
  25. 12 | | pub fn push(&mut self, val: f64)
  26. 13 | | {
  27. ... |
  28. 69 | | }
  29. 70 | | }
  30. | |_^
  31. note: ...so that expression is assignable (expected stack::Stack<'c>, found stack::Stack<'_>)
  32. --> stack.rs:68:3
  33. |
  34. 68 | Stack { data: v}
  35. | ^^^^^^^^^^^^^^^^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement