Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E0515 searching internet for the phrase "owned value" does not give helpful results #62071

Closed
KyleSiefring opened this issue Jun 23, 2019 · 7 comments · Fixed by #138508
Closed
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@KyleSiefring
Copy link

https://doc.rust-lang.org/error-index.html#E0515

Consider returning an owned value instead:

Searching for this phrase does not define it within the first page of a google search.

@KyleSiefring
Copy link
Author

KyleSiefring commented Jun 23, 2019

Is the example (using iter vs into_iter) referring to some sort of design pattern?

@Centril
Copy link
Contributor

Centril commented Jun 23, 2019

Did you search for "owned value" or "rust owned value"?

@KyleSiefring
Copy link
Author

rust owned value

@ExpHP
Copy link
Contributor

ExpHP commented Jun 23, 2019

For the record, when it says "owned value," it means something that does not borrow from anything else.

A precise technical term would be: "something with the 'static lifetime." This would certainly be more searchable, but I'm not certain that the search results that you get for it would be very helpful to the kind of user that is likely to run into this error!

Edit: In fact, the top Google search result is very misleading! https://doc.rust-lang.org/stable/rust-by-example/scope/lifetime/static_lifetime.html . It seems to suggest that only static items and promoted consts have the 'static lifetime, which is simply not true. (it's just that they're the only things that admit a &'static borrow)

@jonas-schievink
Copy link
Contributor

FWIW the book goes into quite a lot of detail here: https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html

@estebank estebank added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Jun 23, 2019
@gilescope
Copy link
Contributor

+1, Link 'owned value' to the book?

@jonas-schievink jonas-schievink added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Mar 6, 2020
@ChiefMilesEdgeworth
Copy link
Contributor

Maybe use this link, and instead of saying "owned value", say "non-reference"?

jhpratt added a commit to jhpratt/rust that referenced this issue Mar 18, 2025
Clarify "owned data" in E0515.md

This clarifies the explanation of why this is not allowed and also what to do instead.

Fixes rust-lang#62071

PS There was suggestion of adding a link to the book. I did not yet do that, but if desired that could be added.
jhpratt added a commit to jhpratt/rust that referenced this issue Mar 18, 2025
Clarify "owned data" in E0515.md

This clarifies the explanation of why this is not allowed and also what to do instead.

Fixes rust-lang#62071

PS There was suggestion of adding a link to the book. I did not yet do that, but if desired that could be added.
@bors bors closed this as completed in 01062ba Mar 18, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 18, 2025
Rollup merge of rust-lang#138508 - hkBst:patch-3, r=wesleywiser

Clarify "owned data" in E0515.md

This clarifies the explanation of why this is not allowed and also what to do instead.

Fixes rust-lang#62071

PS There was suggestion of adding a link to the book. I did not yet do that, but if desired that could be added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants