tokio-rs/axum

Build error with Axum 0.7.5 on vanilla project: error[E0658]: `#[diagnostic]` attribute name space is experimental

Closed this issue · 0 comments

  • I have looked for existing issues (including closed) about this

Bug Report

Version

0.7.5

Platform

Macbook Air M1

uname -a
Darwin andy-mac-m1 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:19 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8103 arm64

Crates

[dependencies]
axum = "0.7.5"

just axum

Description

Error:

error[E0658]: #[diagnostic] attribute name space is experimental
--> /Users/andy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.7.5/src/handler/mod.rs:130:5
|
130 | diagnostic::on_unimplemented(
| ^^^^^^^^^^
|
= note: see issue #111996 rust-lang/rust#111996 for more information
= help: add #![feature(diagnostic_namespace)] to the crate attributes to enable

Steps to reproduce

cargo new axum_test
cd axum_test
cargo add axum
cargo build

Full diagnostic

... bug % cargo new axum_test
Created binary (application) axum_test package
... bug % cd axum_test
... axum_test % cargo add axum
Updating crates.io index
Adding axum v0.7.5 to dependencies.
Features:
+ form
+ http1
+ json
+ matched-path
+ original-uri
+ query
+ tokio
+ tower-log
+ tracing
- __private_docs
- http2
- macros
- multipart
- ws
Updating crates.io index
... axum_test % cargo build
Compiling proc-macro2 v1.0.79
Compiling unicode-ident v1.0.12
Compiling itoa v1.0.11
Compiling libc v0.2.153
Compiling pin-project-lite v0.2.13
Compiling rustversion v1.0.14
Compiling futures-core v0.3.30
Compiling bytes v1.6.0
Compiling fnv v1.0.7
Compiling futures-task v0.3.30
Compiling serde v1.0.197
Compiling pin-utils v0.1.0
Compiling httparse v1.8.0
Compiling once_cell v1.19.0
Compiling futures-util v0.3.30
Compiling tracing-core v0.1.32
Compiling http v1.1.0
Compiling async-trait v0.1.79
Compiling http-body v1.0.0
Compiling log v0.4.21
Compiling tracing v0.1.40
Compiling futures-channel v0.3.30
Compiling socket2 v0.5.6
Compiling mio v0.8.11
Compiling axum-core v0.4.3
Compiling tower-service v0.3.2
Compiling httpdate v1.0.3
Compiling percent-encoding v2.3.1
Compiling quote v1.0.35
Compiling smallvec v1.13.2
Compiling ryu v1.0.17
Compiling serde_json v1.0.115
Compiling syn v2.0.55
Compiling tower-layer v0.3.2
Compiling form_urlencoded v1.2.1
Compiling axum v0.7.5
Compiling http-body-util v0.1.1
Compiling sync_wrapper v0.1.2
Compiling mime v0.3.17
Compiling memchr v2.7.1
Compiling sync_wrapper v1.0.0
Compiling matchit v0.7.3
Compiling serde_path_to_error v0.1.16
Compiling serde_urlencoded v0.7.1
Compiling tokio-macros v2.2.0
Compiling pin-project-internal v1.1.5
Compiling tokio v1.36.0
Compiling pin-project v1.1.5
Compiling hyper v1.2.0
Compiling tower v0.4.13
Compiling hyper-util v0.1.3
error[E0658]: #[diagnostic] attribute name space is experimental
--> ... src/index.crates.io-6f17d22bba15001f/axum-0.7.5/src/handler/mod.rs:130:5
|
130 | diagnostic::on_unimplemented(
| ^^^^^^^^^^
|
= note: see issue #111996 rust-lang/rust#111996 for more information
= help: add #![feature(diagnostic_namespace)] to the crate attributes to enable

For more information about this error, try rustc --explain E0658.
error: could not compile axum (lib) due to 1 previous error

Workaround

Changing Cargo.toml to

[dependencies]
axum = "=0.7.4"

the project compiles