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

Lifetime inference and Pin #54934

Open
withoutboats opened this issue Oct 9, 2018 · 1 comment
Open

Lifetime inference and Pin #54934

withoutboats opened this issue Oct 9, 2018 · 1 comment
Labels
A-inference Area: Type inference A-typesystem Area: The type system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@withoutboats
Copy link
Contributor

There appears to be some lifetime inference issue with how Deref is implemented for Pin, so that I get issues about how the pin does not live long in code that should clearly work. For example, this gives an error about how the pin does not live long enough:

fn foo<'a>(x: Pin<&'a i32>) -> &'a i32 {
    &*x
}

https://play.rust-lang.org/?gist=5749b0645d17308d62501924e618e49d&version=nightly&mode=debug&edition=2015

cc #49150

@Spoonbender
Copy link

Triage: no change

@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inference Area: Type inference A-typesystem Area: The type system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants