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 two instances of elided_named_lifetimes warning #165

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

lukenels
Copy link
Contributor

cargo check on 1.83 currently fails due to the use of #[deny(warnings)] because of two occurrences of the elided_named_lifetimes warning, as shown below:

error: elided lifetime has a name
  --> src/lazy_static.rs:48:34
   |
48 |     pub fn get(&'static self) -> &T {
   |                                  ^ this elided lifetime gets resolved as `'static`
   |
note: the lint level is defined here
  --> src/lib.rs:1:9
   |
1  | #![deny(warnings, missing_debug_implementations, missing_docs)]
   |         ^^^^^^^^
   = note: `#[deny(elided_named_lifetimes)]` implied by `#[deny(warnings)]`
help: consider specifying it explicitly
   |
48 |     pub fn get(&'static self) -> &'static T {
   |                                   +++++++

This commit fixes both of the warnings by applying the recommended fix. Since the elided lifetime is resolved to be 'static anyways, there's no change in behavior.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

`cargo check` on 1.83 currently fails due to the use of `#[deny(warnings)]`
because of two occurrences of the `elided_named_lifetimes` warning,
as shown below:

```
error: elided lifetime has a name
  --> src/lazy_static.rs:48:34
   |
48 |     pub fn get(&'static self) -> &T {
   |                                  ^ this elided lifetime gets resolved as `'static`
   |
note: the lint level is defined here
  --> src/lib.rs:1:9
   |
1  | #![deny(warnings, missing_debug_implementations, missing_docs)]
   |         ^^^^^^^^
   = note: `#[deny(elided_named_lifetimes)]` implied by `#[deny(warnings)]`
help: consider specifying it explicitly
   |
48 |     pub fn get(&'static self) -> &'static T {
   |                                   +++++++
```

This commit fixes both of the warnings by applying the recommended
fix.  Since the elided lifetime is resolved to be `'static` anyways,
there's no change in behavior.
This commit fixes a few Clippy warnings that are set to `deny` and
therefore cause CI checks in pull requests to fail.

I verified that `cargo clippy --all-targets --all-features` succeeds
(with no warnings nor errors) after the fixes.
@bkragl bkragl merged commit 4915ff6 into awslabs:main Nov 29, 2024
5 checks passed
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.

2 participants