-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
#[debug_handler]
causes invalid memory reference error
#1129
Comments
I cannot reproduce it. Works fine for me 🤔 use axum::{routing::get, Router, Server};
#[tokio::main]
async fn main() {
let app = Router::new().route("/", get(root));
Server::bind(&"0.0.0.0:3000".parse().unwrap())
.serve(app.into_make_service())
.await
.unwrap();
}
#[axum_macros::debug_handler]
async fn root() -> &'static str {
"Hello, world!"
} [package]
name = "foo"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = "0.5.10"
axum-core = "0.2.6"
axum-macros = "0.2.3"
tokio = { version = "1.0", features = ["full"] }
That message is from rust-analyzer. I don't exactly know why it only appears sometimes but I don't believe there is anything we can do about it. |
Sorry didn't mean to close quite yet. |
This seems to only occur on WSL; it works fine on both macOS Ventura and Windows 11. |
Oh okay. That's odd. Are you sure you were using the same versions? Isn't WSL "just Linux"? How could it not work just there? 🤷♂️ I don't have access to a machine with WSL so can't test it. |
I'm sorry but I will close this. I doubt this has anything to do with axum. There is no I recommend you ask in the rust-lang users forum if you keep having this issue. |
Bug Report
Version
axum v0.5.10
— axum-core v0.2.6
axum-macros v0.2.3
Platform
Linux Desktop 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
WSL2 Ubuntu 22.04
Crates
axum-macros
Description
When trying to debug "handler doesn't implement
Handler
" issues using#[debug_handler]
, the following error is printed bycargo build
:A simplified version of affected code:
The text was updated successfully, but these errors were encountered: