Skip to content

Commit 5201798

Browse files
authored
Enable diagnostic attributes for Rust 1.78+ (#2693)
1 parent e3bb708 commit 5201798

File tree

6 files changed

+8
-27
lines changed

6 files changed

+8
-27
lines changed

axum-core/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ http-body = "1.0.0"
2626
http-body-util = "0.1.0"
2727
mime = "0.3.16"
2828
pin-project-lite = "0.2.7"
29+
rustversion = "1.0.9"
2930
sync_wrapper = "1.0.0"
3031
tower-layer = "0.3"
3132
tower-service = "0.3"
@@ -34,9 +35,6 @@ tower-service = "0.3"
3435
tower-http = { version = "0.5.0", optional = true, features = ["limit"] }
3536
tracing = { version = "0.1.37", default-features = false, optional = true }
3637

37-
[build-dependencies]
38-
rustversion = "1.0.9"
39-
4038
[dev-dependencies]
4139
axum = { path = "../axum", version = "0.7.2" }
4240
axum-extra = { path = "../axum-extra", features = ["typed-header"] }

axum-core/build.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

axum-core/src/extract/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ mod private {
4343
///
4444
/// [`axum::extract`]: https://docs.rs/axum/0.7/axum/extract/index.html
4545
#[async_trait]
46-
#[cfg_attr(
47-
nightly_error_messages,
46+
#[rustversion::attr(
47+
since(1.78),
4848
diagnostic::on_unimplemented(
4949
note = "Function argument is not a valid axum extractor. \nSee `https://docs.rs/axum/0.7/axum/extract/index.html` for details",
5050
)
@@ -70,8 +70,8 @@ pub trait FromRequestParts<S>: Sized {
7070
///
7171
/// [`axum::extract`]: https://docs.rs/axum/0.7/axum/extract/index.html
7272
#[async_trait]
73-
#[cfg_attr(
74-
nightly_error_messages,
73+
#[rustversion::attr(
74+
since(1.78),
7575
diagnostic::on_unimplemented(
7676
note = "Function argument is not a valid axum extractor. \nSee `https://docs.rs/axum/0.7/axum/extract/index.html` for details",
7777
)

axum/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ memchr = "2.4.1"
5454
mime = "0.3.16"
5555
percent-encoding = "2.1"
5656
pin-project-lite = "0.2.7"
57+
rustversion = "1.0.9"
5758
serde = "1.0"
5859
sync_wrapper = "1.0.0"
5960
tower = { version = "0.4.13", default-features = false, features = ["util"] }
@@ -109,16 +110,12 @@ features = [
109110
"validate-request",
110111
]
111112

112-
[build-dependencies]
113-
rustversion = "1.0.9"
114-
115113
[dev-dependencies]
116114
anyhow = "1.0"
117115
axum-macros = { path = "../axum-macros", version = "0.4.1", features = ["__private"] }
118116
quickcheck = "1.0"
119117
quickcheck_macros = "1.0"
120118
reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "multipart"] }
121-
rustversion = "1.0.9"
122119
serde = { version = "1.0", features = ["derive"] }
123120
serde_json = "1.0"
124121
time = { version = "0.3", features = ["serde-human-readable"] }

axum/build.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

axum/src/handler/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ pub use self::service::HandlerService;
125125
/// )));
126126
/// # let _: Router = app;
127127
/// ```
128-
#[cfg_attr(
129-
nightly_error_messages,
128+
#[rustversion::attr(
129+
since(1.78),
130130
diagnostic::on_unimplemented(
131131
note = "Consider using `#[axum::debug_handler]` to improve the error message"
132132
)

0 commit comments

Comments
 (0)