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

"value may contain borrowed pointers" #6584

Closed
catamorphism opened this issue May 18, 2013 · 10 comments
Closed

"value may contain borrowed pointers" #6584

catamorphism opened this issue May 18, 2013 · 10 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions P-low Low priority

Comments

@catamorphism
Copy link
Contributor

This error message makes me sad, since it doesn't suggest any way to fix the problem. Sorry, I don't have a self-contained example right now, but I'll try to make one later.

@emberian
Copy link
Member

@catamorphism what situation is it generated, at least?

@huonw
Copy link
Member

huonw commented Sep 2, 2013

Triage: it now has a suggestion on how to fix it:

fn foo<T> (t: T) -> @T {
    @t
}

fn main() {}
6584.rs:2:5: 2:6 error: value may contain borrowed pointers; add `'static` bound
6584.rs:2     @t
               ^
error: aborting due to previous error

This appears to be the only explanation of this requirement, a quick skip of the manual (searching for 'static and @) doesn't turn up anything, so leaving this open, and tagging with docs too.

@alexcrichton
Copy link
Member

Nominating, sounds like a pretty bad error message.

@pnkfelix
Copy link
Member

@t is feature gated. Of course we will have it (or Gc), but its not huge for 1.0.

Accepted for P-low.

@steveklabnik
Copy link
Member

I don't even think this error exists anymore:

$ grep -ri "value may contain borrowed pointers" *
$ 

Combined with the removal of @, I think we can close this.

@emberian
Copy link
Member

The error has been renamed to value may contain references

@emberian
Copy link
Member

I think it still comes up with trait objects in general, especially Box<Trait>

@steveklabnik
Copy link
Member

Looking at the tests, there are two instances of this error. one suggests a solution, and the other seems to be specific to Gc. Still unsure what fix to suggest in that case, though.

@steveklabnik
Copy link
Member

triage:

$ git grep "value may contain references"
$

Does anyone know if this is still an issue? Or have an example of how to reproduce?

@steveklabnik
Copy link
Member

It's been a month, and so I'm giving this a close. If someone can give me code to reproduce, we can re-open.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jan 15, 2021
…nks, r=llogiq

Make a reference a link in doc

I think it's incovenient that references in doc are just a text.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions P-low Low priority
Projects
None yet
Development

No branches or pull requests

6 participants