Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

get_vec and the borrow checker play badly together #256

Open
wbl opened this issue Sep 18, 2020 · 1 comment
Open

get_vec and the borrow checker play badly together #256

wbl opened this issue Sep 18, 2020 · 1 comment

Comments

@wbl
Copy link

wbl commented Sep 18, 2020

get_vec returns Vec<&str>. Unfortunately the borrow checker interprets this to make the first argument to get_vec also have static scope, ala https://stackoverflow.com/questions/58436950/argument-requires-that-is-borrowed-for-static-how-do-i-work-round-this.

There do not seem to be any good workarounds other than changing the type of the function.

@wbl
Copy link
Author

wbl commented Oct 2, 2020

Apparently it's possible to tickle the borrow checker into inferring the correct type here without explicit lifetimes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant