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 future rustc lint rule on named lifetime elision (backport #13197) #13199

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 20, 2024

Summary

This commit fixes a future lint rule that will appear in future version of the rust compiler. The new rule will raise a warning at compile time if the code used an elided lifetime resolves to a named lifetime. While this typically would only cause an issue in unsafe rust, it can cause a confusing error message in cases when using functions like this in a safe context. This fixes the code violating this future rule to get ahead of any potential errors when compiling with a release of Rust from the near future.

This rule is documented here:

https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/builtin/static.ELIDED_NAMED_LIFETIMES.html

Details and comments
This is an automatic backport of pull request #13197 done by Mergify.

This commit fixes a future lint rule that will appear in future version
of the rust compiler. The new rule will raise a warning at compile time
if the code used an elided lifetime resolves to a named lifetime. While
this typically would only cause an issue in unsafe rust, it can cause a
confusing error message in cases when using functions like this in a
safe context. This fixes the code violating this future rule to get
ahead of any potential errors when compiling with a release of Rust from
the near future.

This rule is documented here:

https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/builtin/static.ELIDED_NAMED_LIFETIMES.html
(cherry picked from commit 12ecea7)
@mergify mergify bot requested a review from a team as a code owner September 20, 2024 13:19
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @kevinhartman
  • @mtreinish

@github-actions github-actions bot added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository labels Sep 20, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10960029427

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.003%) to 89.777%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.02%
crates/qasm2/src/lex.rs 5 91.98%
Totals Coverage Status
Change from base Build 10959931349: -0.003%
Covered Lines: 66891
Relevant Lines: 74508

💛 - Coveralls

@ElePT ElePT disabled auto-merge September 20, 2024 13:58
@jakelishman jakelishman added this pull request to the merge queue Sep 20, 2024
Merged via the queue into stable/1.2 with commit b15f8ca Sep 20, 2024
18 checks passed
@mtreinish mtreinish deleted the mergify/bp/stable/1.2/pr-13197 branch September 27, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants