Skip to content
New issue

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

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

Already on GitHub? # to your account

remove incorrect lifetime annotation #1

Merged
merged 1 commit into from
Aug 16, 2022
Merged

Conversation

aliemjay
Copy link
Contributor

@aliemjay aliemjay commented Aug 16, 2022

Hi,
rustc was previously accepting this incorrect code:

async fn test<'a>() { // `'a`, being a lifetime parameter, must be longer than the entire function body
    let f = |_: &'a str| {}; // the argument is required to outlive `'a`
    f(&String::new()); // an argument of shorter lifetime is passed!
}

Now that this is fixed, we found that FGC.rs relies on this bug. This PR tries to fix this.

@nielsdos
Copy link
Owner

LGTM, thanks!

@nielsdos nielsdos merged commit f00dfd9 into nielsdos:main Aug 16, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants