@@ -1303,11 +1303,12 @@ impl<T> SizedTypeProperties for T {}
1303
1303
/// Enum variants may be traversed as if they were fields. Variants themselves do
1304
1304
/// not have an offset.
1305
1305
///
1306
+ /// However, on stable only a single field name is supported, which blocks the use of
1307
+ /// enum support.
1308
+ ///
1306
1309
/// Visibility is respected - all types and fields must be visible to the call site:
1307
1310
///
1308
1311
/// ```
1309
- /// #![feature(offset_of)]
1310
- ///
1311
1312
/// mod nested {
1312
1313
/// #[repr(C)]
1313
1314
/// pub struct Struct {
@@ -1330,8 +1331,6 @@ impl<T> SizedTypeProperties for T {}
1330
1331
/// not *identical*, e.g.:
1331
1332
///
1332
1333
/// ```
1333
- /// #![feature(offset_of)]
1334
- ///
1335
1334
/// struct Wrapper<T, U>(T, U);
1336
1335
///
1337
1336
/// type A = Wrapper<u8, u8>;
@@ -1359,8 +1358,7 @@ impl<T> SizedTypeProperties for T {}
1359
1358
/// # Examples
1360
1359
///
1361
1360
/// ```
1362
- /// #![feature(offset_of)]
1363
- /// # #![feature(offset_of_enum)]
1361
+ /// #![feature(offset_of_enum, offset_of_nested)]
1364
1362
///
1365
1363
/// use std::mem;
1366
1364
/// #[repr(C)]
@@ -1395,7 +1393,7 @@ impl<T> SizedTypeProperties for T {}
1395
1393
///
1396
1394
/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
1397
1395
/// ```
1398
- #[ unstable ( feature = "offset_of" , issue = "106655 " ) ]
1396
+ #[ stable ( feature = "offset_of" , since = "CURRENT_RUSTC_VERSION " ) ]
1399
1397
#[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
1400
1398
pub macro offset_of ( $Container: ty, $( $fields: tt) . + $( , ) ?) {
1401
1399
// The `{}` is for better error messages
0 commit comments