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

🚨 Explicit lifetimes for constant string literals #36

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

zeenix
Copy link
Collaborator

@zeenix zeenix commented Jan 30, 2024

warning: `&` without an explicit lifetime name cannot be used here
  --> src/fdo/dbus.rs:29:21
   |
29 |     pub const PATH: &str = "/org/freedesktop/DBus";
   |                     ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
   = note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
help: use the `'static` lifetime
   |
29 |     pub const PATH: &'static str = "/org/freedesktop/DBus";
   |                      +++++++

```
warning: `&` without an explicit lifetime name cannot be used here
  --> src/fdo/dbus.rs:29:21
   |
29 |     pub const PATH: &str = "/org/freedesktop/DBus";
   |                     ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <rust-lang/rust#115010>
   = note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
help: use the `'static` lifetime
   |
29 |     pub const PATH: &'static str = "/org/freedesktop/DBus";
   |                      +++++++
```
@zeenix zeenix enabled auto-merge January 30, 2024 12:57
@zeenix zeenix merged commit 7c6343f into dbus2:main Jan 30, 2024
8 checks passed
@zeenix zeenix deleted the const-lifetimes branch April 30, 2024 19:58
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.

1 participant