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

The compiler encounters some warning messages #211

Closed
dierbei opened this issue Sep 5, 2023 · 3 comments · Fixed by #212
Closed

The compiler encounters some warning messages #211

dierbei opened this issue Sep 5, 2023 · 3 comments · Fixed by #212
Assignees
Labels
🚀 enhancement New feature or request 👋 good first issue Good for newcomers
Milestone

Comments

@dierbei
Copy link
Contributor

dierbei commented Sep 5, 2023

Describe the bug

warning: `&` without an explicit lifetime name cannot be used here
  --> crates/router/src/files.rs:25:33
   |
25 |     const PUBLIC_ASSETS_FOLDER: &str = "public";
   |                                 ^
   |
   = 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
   |
25 |     const PUBLIC_ASSETS_FOLDER: &'static str = "public";
   |                                  +++++++

warning: `&` without an explicit lifetime name cannot be used here
  --> crates/router/src/files.rs:26:32
   |
26 |     const DEFAULT_EXTENSIONS: [&str; 2] = ["js", "wasm"];
   |                                ^
   |
   = 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>
help: use the `'static` lifetime
   |
26 |     const DEFAULT_EXTENSIONS: [&'static str; 2] = ["js", "wasm"];
   |                                 +++++++

   Compiling wws-api-manage v1.5.0 (/root/dierbei/wasm-workers-server/crates/api-manage)
   Compiling wws-server v1.5.0 (/root/dierbei/wasm-workers-server/crates/server)
   Compiling wasm-workers-server v1.5.0 (/root/dierbei/wasm-workers-server)
warning: `wws-router` (lib) generated 2 warnings (run `cargo fix --lib -p wws-router` to apply 2 suggestions)
    Finished release [optimized] target(s) in 4m 08s

Reproduction steps

make build

Expected behavior

No warning message.

Additional context

I encountered some warning messages while compiling the project.

Is this perhaps not a big problem and is there a need to fix it?

@ereslibre
Copy link
Contributor

Thank you for the report @dierbei! Given support for the elided lifetime is being phased out on the rustc compiler, I think it would be great to fix it! Would you like to go ahead and open a PR?

@ereslibre ereslibre added 🚀 enhancement New feature or request 👋 good first issue Good for newcomers labels Sep 5, 2023
@ereslibre ereslibre added this to the v1.6.0 milestone Sep 5, 2023
@dierbei
Copy link
Contributor Author

dierbei commented Sep 5, 2023

@ereslibre I'd love to do that.

@ereslibre
Copy link
Contributor

Assigned to you @dierbei, thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request 👋 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants