Creating a vector and returning it along with a reference to one of its elements

Rust doesn't allow you to do that without unsafe code. Probably your best option is to return the vector with the index of the element in question.

This is conceptually very similar to trying to create a self-referential struct. See this for more on why this is challenging.