Skip to content

Commit 79b2b10

Browse files
committed
Move rust feature docs into a more useful place.
1 parent 18a64e6 commit 79b2b10

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/features.rs

+17-14
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,36 @@ macro_rules! rust_target_base {
9191
/// Rust stable 1.1
9292
=> Stable_1_1 => 1.1;
9393
/// Rust stable 1.19
94+
/// * Untagged unions ([RFC 1444](https://github.com/rust-lang/rfcs/blob/master/text/1444-union.md))
9495
=> Stable_1_19 => 1.19;
9596
/// Rust stable 1.20
97+
/// * Associated constants ([PR](https://github.com/rust-lang/rust/pull/42809))
9698
=> Stable_1_20 => 1.20;
9799
/// Rust stable 1.21
100+
/// * Builtin impls for `Clone` ([PR](https://github.com/rust-lang/rust/pull/43690))
98101
=> Stable_1_21 => 1.21;
99102
/// Rust stable 1.25
103+
/// * `repr(align)` ([PR](https://github.com/rust-lang/rust/pull/47006))
100104
=> Stable_1_25 => 1.25;
101105
/// Rust stable 1.26
106+
/// * [i128 / u128 support](https://doc.rust-lang.org/std/primitive.i128.html)
102107
=> Stable_1_26 => 1.26;
103108
/// Rust stable 1.27
109+
/// * `must_use` attribute on functions ([PR](https://github.com/rust-lang/rust/pull/48925))
104110
=> Stable_1_27 => 1.27;
105111
/// Rust stable 1.28
112+
/// * `repr(transparent)` ([PR](https://github.com/rust-lang/rust/pull/51562))
106113
=> Stable_1_28 => 1.28;
107114
/// Rust stable 1.30
115+
/// * `const fn` support for limited cases ([PR](https://github.com/rust-lang/rust/pull/54835/)
116+
/// * [c_void available in core](https://doc.rust-lang.org/core/ffi/enum.c_void.html)
108117
=> Stable_1_30 => 1.30;
109118
/// Rust stable 1.33
119+
/// * repr(packed(N)) ([PR](https://github.com/rust-lang/rust/pull/57049))
110120
=> Stable_1_33 => 1.33;
111121
/// Nightly rust
122+
/// * `thiscall` calling convention ([Tracking issue](https://github.com/rust-lang/rust/issues/42202))
123+
/// * `non_exhaustive` enums/structs ([Tracking issue](https://github.com/rust-lang/rust/issues/44109))
112124
=> Nightly => nightly;
113125
);
114126
}
@@ -129,7 +141,8 @@ macro_rules! rust_feature_def {
129141
) => {
130142
/// Features supported by a rust target
131143
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
132-
pub struct RustFeatures {
144+
#[allow(missing_docs)] // Documentation should go into the relevant variants.
145+
pub(crate) struct RustFeatures {
133146
$( $(
134147
$(
135148
#[$attr]
@@ -167,50 +180,40 @@ macro_rules! rust_feature_def {
167180
}
168181
}
169182

183+
// NOTE(emilio): When adding or removing features here, make sure to update the
184+
// documentation for the relevant variant in the rust_target_base macro
185+
// definition.
170186
rust_feature_def!(
171187
Stable_1_19 {
172-
/// Untagged unions ([RFC 1444](https://github.com/rust-lang/rfcs/blob/master/text/1444-union.md))
173188
=> untagged_union;
174189
}
175190
Stable_1_20 {
176-
/// associated constants ([PR](https://github.com/rust-lang/rust/pull/42809))
177191
=> associated_const;
178192
}
179193
Stable_1_21 {
180-
/// builtin impls for `Clone` ([PR](https://github.com/rust-lang/rust/pull/43690))
181194
=> builtin_clone_impls;
182195
}
183196
Stable_1_25 {
184-
/// repr(align) ([PR](https://github.com/rust-lang/rust/pull/47006))
185197
=> repr_align;
186198
}
187199
Stable_1_26 {
188-
/// [i128 / u128 support](https://doc.rust-lang.org/std/primitive.i128.html)
189200
=> i128_and_u128;
190201
}
191202
Stable_1_27 {
192-
/// `must_use` attribute on functions ([PR](https://github.com/rust-lang/rust/pull/48925))
193203
=> must_use_function;
194204
}
195205
Stable_1_28 {
196-
/// repr(transparent) ([PR](https://github.com/rust-lang/rust/pull/51562))
197206
=> repr_transparent;
198207
}
199208
Stable_1_30 {
200-
/// `const fn` support for limited cases
201-
/// ([PR](https://github.com/rust-lang/rust/pull/54835/)
202209
=> min_const_fn;
203-
/// [c_void available in core](https://doc.rust-lang.org/core/ffi/enum.c_void.html)
204210
=> core_ffi_c_void;
205211
}
206212
Stable_1_33 {
207-
/// repr(packed(N)) ([PR](https://github.com/rust-lang/rust/pull/57049))
208213
=> repr_packed_n;
209214
}
210215
Nightly {
211-
/// `thiscall` calling convention ([Tracking issue](https://github.com/rust-lang/rust/issues/42202))
212216
=> thiscall_abi;
213-
/// `non_exhaustive` enums/structs ([Tracking issue](https://github.com/rust-lang/rust/issues/44109))
214217
=> non_exhaustive;
215218
}
216219
);

0 commit comments

Comments
 (0)