Skip to content

Commit e8ad687

Browse files
committed
Enable the nightly-error-messages feature unconditionally for nightly compilers
1 parent 8c992c0 commit e8ad687

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

axum-core/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ mime = "0.3.16"
2121
tower-layer = "0.3"
2222
tower-service = "0.3"
2323

24+
[build-dependencies]
25+
rustversion = "1.0.9"
26+
2427
[dev-dependencies]
2528
axum = { path = "../axum", version = "0.6.0-rc.2" }
2629
futures-util = "0.3"
2730
hyper = "0.14"
2831
tokio = { version = "1.0", features = ["macros"] }
2932
tower-http = { version = "0.3.4", features = ["limit"] }
30-
31-
[features]
32-
nightly-error-messages = []

axum-core/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#[rustversion::nightly]
2+
fn main() {
3+
println!("cargo:rustc-cfg=nightly_error_messages");
4+
}
5+
6+
#[rustversion::not(nightly)]
7+
fn main() {}

axum-core/src/extract/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod private {
4040
/// [`axum::extract`]: https://docs.rs/axum/0.6.0-rc.2/axum/extract/index.html
4141
#[async_trait]
4242
#[cfg_attr(
43-
feature = "nightly-error-messages",
43+
nightly_error_messages,
4444
rustc_on_unimplemented(
4545
on(
4646
_Self = "axum::http::Request<axum::body::Body>",

axum-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(feature = "nightly-error-messages", feature(rustc_attrs))]
1+
#![cfg_attr(nightly_error_messages, feature(rustc_attrs))]
22
//! Core types and traits for [`axum`].
33
//!
44
//! Libraries authors that want to provide [`FromRequest`] or [`IntoResponse`] implementations

axum/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ query = ["dep:serde_urlencoded"]
2525
tokio = ["dep:tokio", "hyper/server", "hyper/tcp", "tower/make"]
2626
tower-log = ["tower/log"]
2727
ws = ["tokio", "dep:tokio-tungstenite", "dep:sha-1", "dep:base64"]
28-
nightly-error-messages = ["axum-core/nightly-error-messages"]
2928

3029
# Required for intra-doc links to resolve correctly
3130
__private_docs = ["tower/full", "tower-http/full"]
@@ -64,6 +63,9 @@ sha-1 = { version = "0.10", optional = true }
6463
tokio = { package = "tokio", version = "1.21", features = ["time"], optional = true }
6564
tokio-tungstenite = { version = "0.17.2", optional = true }
6665

66+
[build-dependencies]
67+
rustversion = "1.0.9"
68+
6769
[dev-dependencies]
6870
anyhow = "1.0"
6971
futures = "0.3"

axum/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#[rustversion::nightly]
2+
fn main() {
3+
println!("cargo:rustc-cfg=nightly_error_messages");
4+
}
5+
6+
#[rustversion::not(nightly)]
7+
fn main() {}

axum/src/handler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub(crate) use self::{
100100
/// ```
101101
#[doc = include_str!("../docs/debugging_handler_type_errors.md")]
102102
#[cfg_attr(
103-
feature = "nightly-error-messages",
103+
nightly_error_messages,
104104
rustc_on_unimplemented(
105105
note = "Consider using `#[axum_macros::debug_handler]` to improve the error message"
106106
)

axum/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(feature = "nightly-error-messages", feature(rustc_attrs))]
1+
#![cfg_attr(nightly_error_messages, feature(rustc_attrs))]
22
//! axum is a web application framework that focuses on ergonomics and modularity.
33
//!
44
//! # Table of contents

0 commit comments

Comments
 (0)