Skip to content

Commit bf9ebea

Browse files
committed
Mark every trait impl for a private type with do_not_recommend
1 parent 6c316d7 commit bf9ebea

File tree

6 files changed

+87
-16
lines changed

6 files changed

+87
-16
lines changed

serde/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ fn main() {
1414
};
1515

1616
if minor >= 77 {
17+
println!("cargo:rustc-check-cfg=cfg(no_diagnostic_namespace)");
1718
println!("cargo:rustc-check-cfg=cfg(no_serde_derive)");
1819
}
1920

2021
// Current minimum supported version of serde_derive crate is Rust 1.61.
2122
if minor < 61 {
2223
println!("cargo:rustc-cfg=no_serde_derive");
2324
}
25+
26+
// Support for the `#[diagnostic]` tool attribute namespace
27+
// https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html#diagnostic-attributes
28+
if minor < 78 {
29+
println!("cargo:rustc-cfg=no_diagnostic_namespace");
30+
}
2431
}
2532

2633
fn rustc_minor_version() -> Option<u32> {

0 commit comments

Comments
 (0)