Skip to content

Commit 7e41749

Browse files
authored
Deprecate Rust targets lower or equal than 1.30 (#2356)
1 parent 046d6f9 commit 7e41749

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@
159159

160160
* Replace the `name: &str` argument for `ParseCallbacks::add_derives` by
161161
`info: DeriveInfo`.
162+
* All the rust targets equal or lower than `1.30` are being deprecated and
163+
will be removed in the future. If you have a good reason to use any of these
164+
targets, please report it in the issue tracker.
162165

163166
## Removed
164167

bindgen/features.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
#![deny(missing_docs)]
44
#![deny(unused_extern_crates)]
5+
#![allow(deprecated)]
56

67
use std::io;
78
use std::str::FromStr;
@@ -86,35 +87,35 @@ macro_rules! rust_target_base {
8687
( $x_macro:ident ) => {
8788
$x_macro!(
8889
/// Rust stable 1.0
89-
=> Stable_1_0 => 1.0;
90+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_0 => 1.0;
9091
/// Rust stable 1.17
9192
/// * Static lifetime elision ([RFC 1623](https://github.com/rust-lang/rfcs/blob/master/text/1623-static.md))
92-
=> Stable_1_17 => 1.17;
93+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_17 => 1.17;
9394
/// Rust stable 1.19
9495
/// * Untagged unions ([RFC 1444](https://github.com/rust-lang/rfcs/blob/master/text/1444-union.md))
95-
=> Stable_1_19 => 1.19;
96+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_19 => 1.19;
9697
/// Rust stable 1.20
9798
/// * Associated constants ([PR](https://github.com/rust-lang/rust/pull/42809))
98-
=> Stable_1_20 => 1.20;
99+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_20 => 1.20;
99100
/// Rust stable 1.21
100101
/// * Builtin impls for `Clone` ([PR](https://github.com/rust-lang/rust/pull/43690))
101-
=> Stable_1_21 => 1.21;
102+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_21 => 1.21;
102103
/// Rust stable 1.25
103104
/// * `repr(align)` ([PR](https://github.com/rust-lang/rust/pull/47006))
104-
=> Stable_1_25 => 1.25;
105+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_25 => 1.25;
105106
/// Rust stable 1.26
106107
/// * [i128 / u128 support](https://doc.rust-lang.org/std/primitive.i128.html)
107-
=> Stable_1_26 => 1.26;
108+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_26 => 1.26;
108109
/// Rust stable 1.27
109110
/// * `must_use` attribute on functions ([PR](https://github.com/rust-lang/rust/pull/48925))
110-
=> Stable_1_27 => 1.27;
111+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_27 => 1.27;
111112
/// Rust stable 1.28
112113
/// * `repr(transparent)` ([PR](https://github.com/rust-lang/rust/pull/51562))
113-
=> Stable_1_28 => 1.28;
114+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_28 => 1.28;
114115
/// Rust stable 1.30
115116
/// * `const fn` support for limited cases ([PR](https://github.com/rust-lang/rust/pull/54835/)
116117
/// * [c_void available in core](https://doc.rust-lang.org/core/ffi/enum.c_void.html)
117-
=> Stable_1_30 => 1.30;
118+
#[deprecated = "This rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues"] => Stable_1_30 => 1.30;
118119
/// Rust stable 1.33
119120
/// * repr(packed(N)) ([PR](https://github.com/rust-lang/rust/pull/57049))
120121
=> Stable_1_33 => 1.33;

bindgen/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,13 @@ impl Builder {
731731
///
732732
/// The default is the latest stable Rust version
733733
pub fn rust_target(mut self, rust_target: RustTarget) -> Self {
734+
#[allow(deprecated)]
735+
if rust_target <= RustTarget::Stable_1_30 {
736+
warn!(
737+
"The {} rust target is deprecated. If you have a good reason to use this target please report it at https://github.com/rust-lang/rust-bindgen/issues",
738+
String::from(rust_target)
739+
);
740+
}
734741
self.options.set_rust_target(rust_target);
735742
self
736743
}

0 commit comments

Comments
 (0)