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

Remove unneeded lifetime annotations #389

Merged

Conversation

Hofer-Julian
Copy link
Contributor

It seems like none of these annotations are necessary. After removing them, everything still compiles and works as expected.

@adamreichold
Copy link
Member

@Hofer-Julian The Clippy lint is unrelated, but could you fix it nevertheless by explicitly allowing the lint? (We want to test this case even if we do not need a Vec to store 1, 2 and 3.)

@Hofer-Julian
Copy link
Contributor Author

Couldn't test it easily locally.
Let's see if this does the trick.

tests/to_py.rs Outdated Show resolved Hide resolved
@adamreichold adamreichold merged commit 3a18675 into PyO3:main Sep 8, 2023
4 of 29 checks passed
@adamreichold
Copy link
Member

Thanks!

@Hofer-Julian Hofer-Julian deleted the remove-unneeded-lifetime-annotations branch September 8, 2023 14:50
@mejrs
Copy link
Member

mejrs commented Sep 8, 2023

These lifetimes are on purpose, see also https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#elided-lifetimes-in-paths . Can this PR be reverted?

@adamreichold
Copy link
Member

adamreichold commented Sep 8, 2023

These lifetimes are on purpose, see also https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#elided-lifetimes-in-paths . Can this PR be reverted?

While I see their value as documentation I am also not particularly keen on having them (i.e. I did not enable the lint). Do you see any functional issues with removing them?

(Reverting is obviously technically possible, but I am just not invested one way or the other. If we do revert because we really want the lifetimes, we should probably enable the lint though.)

@mejrs
Copy link
Member

mejrs commented Sep 8, 2023

I don't actually care that much because I don't feel that strongly about rust-numpy but I enabled that lint in pyo3 because I've seen many newbies struggle because of hidden lifetimes parameters. My preference is to enable that lint everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants