Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. $ cargo b -q
  2. error: cannot infer an appropriate lifetime
  3. --> src/lib.rs:381:14
  4. |
  5. 380 | pub fn dynamic_entries(&self, tag: DynamicTag) -> impl Iterator<Item = Addr> {
  6. | -------------------------- this return type evaluates to the `'static` lifetime...
  7. 381 | self.dynamic_table()
  8. | ---- ^^^^^^^^^^^^^
  9. | |
  10. | ...but this borrow...
  11. |
  12. note: ...can't outlive the anonymous lifetime #1 defined on the method body at 380:5
  13. --> src/lib.rs:380:5
  14. |
  15. 380 | / pub fn dynamic_entries(&self, tag: DynamicTag) -> impl Iterator<Item = Addr> {
  16. 381 | | self.dynamic_table()
  17. 382 | | .unwrap_or_default()
  18. 383 | | .iter()
  19. 384 | | .filter(|e| e.tag == tag)
  20. 385 | | .map(|e| e.addr)
  21. 386 | | }
  22. | |_____^
  23. help: you can add a constraint to the return type to make it last less than `'static` and match the anonymous lifetime #1 defined on the method body at 380:5
  24. |
  25. 380 | pub fn dynamic_entries(&self, tag: DynamicTag) -> impl Iterator<Item = Addr> + '_ {
  26. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement