Skip to content

Fix "hiding a lifetime that's elided elsewhere is confusing" warnings on the Nightly compiler - #795

Merged
guybedford merged 1 commit into
cloudflare:mainfrom
jakubadamw:fix-warnings-on-nightly
Sep 2, 2025
Merged

Fix "hiding a lifetime that's elided elsewhere is confusing" warnings on the Nightly compiler#795
guybedford merged 1 commit into
cloudflare:mainfrom
jakubadamw:fix-warnings-on-nightly

Conversation

@jakubadamw

@jakubadamw jakubadamw commented Aug 30, 2025

Copy link
Copy Markdown
Contributor

The warnings in question:

warning: hiding a lifetime that's elided elsewhere is confusing
  --> worker/src/durable.rs:80:25
   |
80 |     pub fn id_from_name(&self, name: &str) -> Result<ObjectId> {
   |                         ^^^^^                        ^^^^^^^^ 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
   = note: `-D mismatched-lifetime-syntaxes` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(mismatched_lifetime_syntaxes)]`
help: use `'_` for type paths
   |
80 |     pub fn id_from_name(&self, name: &str) -> Result<ObjectId<'_>> {
   |                                                              ++++

warning: hiding a lifetime that's elided elsewhere is confusing
  --> worker/src/durable.rs:98:27
   |
98 |     pub fn id_from_string(&self, hex_id: &str) -> Result<ObjectId> {
   |                           ^^^^^                          ^^^^^^^^ 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
help: use `'_` for type paths
   |
98 |     pub fn id_from_string(&self, hex_id: &str) -> Result<ObjectId<'_>> {
   |                                                                  ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> worker/src/durable.rs:111:22
    |
111 |     pub fn unique_id(&self) -> Result<ObjectId> {
    |                      ^^^^^            ^^^^^^^^ 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
help: use `'_` for type paths
    |
111 |     pub fn unique_id(&self) -> Result<ObjectId<'_>> {
    |                                               ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> worker/src/durable.rs:130:40
    |
130 |     pub fn unique_id_with_jurisdiction(&self, jd: &str) -> Result<ObjectId> {
    |                                        ^^^^^                      ^^^^^^^^ 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
help: use `'_` for type paths
    |
130 |     pub fn unique_id_with_jurisdiction(&self, jd: &str) -> Result<ObjectId<'_>> {
    |                                                                           ++++

warning: hiding a lifetime that's elided elsewhere is confusing
  --> worker/src/r2/mod.rs:45:16
   |
45 |     pub fn get(&self, key: impl Into<String>) -> GetOptionsBuilder {
   |                ^^^^^ the lifetime is elided here ^^^^^^^^^^^^^^^^^ the same lifetime is hidden here
   |
   = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
   |
45 |     pub fn get(&self, key: impl Into<String>) -> GetOptionsBuilder<'_> {
   |                                                                   ++++

warning: hiding a lifetime that's elided elsewhere is confusing
  --> worker/src/r2/mod.rs:59:16
   |
59 |     pub fn put(&self, key: impl Into<String>, value: impl Into<Data>) -> PutOptionsBuilder {
   |                ^^^^^ the lifetime is elided here                         ^^^^^^^^^^^^^^^^^ the same lifetime is hidden here
   |
   = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
   |
59 |     pub fn put(&self, key: impl Into<String>, value: impl Into<Data>) -> PutOptionsBuilder<'_> {
   |                                                                                           ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> worker/src/r2/mod.rs:101:17
    |
101 |     pub fn list(&self) -> ListOptionsBuilder {
    |                 ^^^^^     ^^^^^^^^^^^^^^^^^^ 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
help: use `'_` for type paths
    |
101 |     pub fn list(&self) -> ListOptionsBuilder<'_> {
    |                                             ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> worker/src/r2/mod.rs:118:9
    |
118 |         &self,
    |         ^^^^^ the lifetime is elided here
119 |         key: impl Into<String>,
120 |     ) -> CreateMultipartUploadOptionsBuilder {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the same lifetime is hidden here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
    |
120 |     ) -> CreateMultipartUploadOptionsBuilder<'_> {
    |                                             ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> worker/src/r2/mod.rs:273:17
    |
273 |     pub fn body(&self) -> Option<ObjectBody> {
    |                 ^^^^^            ^^^^^^^^^^ 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
help: use `'_` for type paths
    |
273 |     pub fn body(&self) -> Option<ObjectBody<'_>> {
    |                                            ++++

warning: hiding a lifetime that's elided elsewhere is confusing
   --> worker/src/websocket.rs:211:19
    |
211 |     pub fn events(&self) -> Result<EventStream> {
    |                   ^^^^^            ^^^^^^^^^^^ 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
help: use `'_` for type paths
    |
211 |     pub fn events(&self) -> Result<EventStream<'_>> {
    |                                               ++++

@guybedford
guybedford merged commit 155be5e into cloudflare:main Sep 2, 2025
3 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