Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
- --> stack.rs:68:3
- |
- 68 | Stack { data: v}
- | ^^^^^
- |
- note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 66:2...
- --> stack.rs:66:2
- |
- 66 | / pub fn new_w_vec(v: &mut Vec<f64>) -> Self
- 67 | | {
- 68 | | Stack { data: v}
- 69 | | }
- | |__^
- note: ...so that reference does not outlive borrowed content
- --> stack.rs:68:17
- |
- 68 | Stack { data: v}
- | ^
- note: but, the lifetime must be valid for the lifetime 'c as defined on the impl at 10:1...
- --> stack.rs:10:1
- |
- 10 | / impl<'c> Stack<'c>
- 11 | | {
- 12 | | pub fn push(&mut self, val: f64)
- 13 | | {
- ... |
- 69 | | }
- 70 | | }
- | |_^
- note: ...so that expression is assignable (expected stack::Stack<'c>, found stack::Stack<'_>)
- --> stack.rs:68:3
- |
- 68 | Stack { data: v}
- | ^^^^^^^^^^^^^^^^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement