The compiler encounters some `warning` messages
dierbei opened this issue · comments
HeDui commented
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?
Rafael Fernández López commented
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?
HeDui commented
@ereslibre I'd love to do that.
Rafael Fernández López commented
Assigned to you @dierbei, thank you! :)