Skip to content

Fix lifetime warning by explicitly inferring from context #2887

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

Merged
merged 1 commit into from
Aug 10, 2025

Conversation

byfnoel
Copy link
Contributor

@byfnoel byfnoel commented Aug 10, 2025

Look below for context:

--> src/repositories/updater.rs:311:36
     |
     | pub(crate) fn repository_name(url: &str) -> Option<RepositoryName> {
     |                                    ^^^^            -------------- the same lifetime is hidden here
     |                                    |
     |                                    the lifetime is elided here
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing

… context

For context:

```
--> src/repositories/updater.rs:311:36
     |
     | pub(crate) fn repository_name(url: &str) -> Option<RepositoryName> {
     |                                    ^^^^            -------------- the same lifetime is hidden here
     |                                    |
     |                                    the lifetime is elided here
     |
     = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
````
@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Aug 10, 2025
@byfnoel byfnoel marked this pull request as ready for review August 10, 2025 16:05
@byfnoel byfnoel requested a review from a team as a code owner August 10, 2025 16:05
@byfnoel byfnoel changed the title Fix lifetime warning by explicitly telling the compiler to infer from context Fix lifetime warning by explicitly inferring from context Aug 10, 2025
@GuillaumeGomez
Copy link
Member

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit 231f6a1 into rust-lang:master Aug 10, 2025
11 checks passed
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Aug 10, 2025
@byfnoel
Copy link
Contributor Author

byfnoel commented Aug 10, 2025

Thank you for merging this.

@byfnoel byfnoel deleted the specify-lifetime branch August 10, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants