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

fix: New lifetime warnings in Rust 1.83 #5564

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

jbencin
Copy link
Contributor

@jbencin jbencin commented Dec 11, 2024

Description

Rust 1.83 seems to be more strict about declaring lifetimes and now generates warnings for certain cases in which they are elided. Example:

   Compiling clarity v0.0.1 (/home/jbencin/git/stacks-core/clarity)
warning: elided lifetime has a name
   --> clarity/./src/vm/contexts.rs:560:31
    |
500 | impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
    |      -- lifetime `'a` declared here
...
560 |     ) -> OwnedEnvironment<'a, '_> {
    |                               ^^ this elided lifetime gets resolved as `'a`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default

This PR fixes the warnings by explicitly declaring the lifetimes

@jbencin jbencin requested a review from a team as a code owner December 11, 2024 21:17
Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for catching this!

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jcnelson jcnelson added this pull request to the merge queue Dec 12, 2024
Merged via the queue into stacks-network:develop with commit 1fb8e1b Dec 12, 2024
11 checks passed
@jbencin jbencin deleted the fix/rust-1.83-warnings branch December 12, 2024 15:32
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants