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

warning: & without an explicit lifetime name cannot be used here #1619

Closed
1 of 3 tasks
WolfeCub opened this issue Nov 8, 2023 · 2 comments
Closed
1 of 3 tasks

warning: & without an explicit lifetime name cannot be used here #1619

WolfeCub opened this issue Nov 8, 2023 · 2 comments
Labels
tweak Small changes to improve experience

Comments

@WolfeCub
Copy link
Contributor

WolfeCub commented Nov 8, 2023

Problem

When using server functions (as in the fullstack axum-router example) calls to the server macro have the following warning:

warning: `&` without an explicit lifetime name cannot be used here
  --> packages/fullstack/examples/axum-router/src/main.rs:86:1
   |
86 | #[server(PostServerData)]
   | ^
   |
   = 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
   = note: this warning originates in the attribute macro `server` (in Nightly builds, run with -Z macro-backtrace for more info)

Steps To Reproduce

git clone https://github.com/DioxusLabs/dioxus.git
cd dioxus/packages/fullstack/examples/axum-router
dx build --features web --release
cargo run --features ssr --release

Expected behavior

Macro shouldn't create warnings.

Screenshots

image

Environment:

  • Dioxus version: 0.4 and master
  • Rust version:
$ rustup show

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/wolfe/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.75.0-nightly (7adc89b69 2023-11-07)
  • OS info: arch
  • App platform: web

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@WolfeCub
Copy link
Contributor Author

WolfeCub commented Nov 8, 2023

Doing a bit more investigation: I found that dioxus makes use of the server_fn package. Checking for issues there I stumbled across this: leptos-rs/leptos#1580. Looking at the commit it seems it was only in 0.5.x releases and dioxus-fullstack is still on 0.4.6. Updating to the latest version seems to work.

I went ahead and created #1620. I haven't contributed here before so let me know if I've missed anything or if there's anything else I need to do.

Thanks!

@ealmloff ealmloff added the tweak Small changes to improve experience label Nov 17, 2023
@ealmloff
Copy link
Member

Fixed in #1620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tweak Small changes to improve experience
Projects
None yet
Development

No branches or pull requests

2 participants