@@ -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)]
@@ -1396,15 +1394,15 @@ impl<T> SizedTypeProperties for T {}
1396
1394
/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
1397
1395
/// ```
1398
1396
#[ cfg( not( bootstrap) ) ]
1399
- #[ unstable ( feature = "offset_of" , issue = "106655 " ) ]
1397
+ #[ stable ( feature = "offset_of" , since = "CURRENT_RUSTC_VERSION " ) ]
1400
1398
#[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
1401
1399
pub macro offset_of ( $Container: ty, $( $fields: expr) + $( , ) ?) {
1402
1400
// The `{}` is for better error messages
1403
1401
crate :: hint:: must_use ( { builtin # offset_of ( $Container, $( $fields) +) } )
1404
1402
}
1405
1403
1406
1404
#[ cfg( bootstrap) ]
1407
- #[ unstable ( feature = "offset_of" , issue = "106655 " ) ]
1405
+ #[ stable ( feature = "offset_of" , since = "CURRENT_RUSTC_VERSION " ) ]
1408
1406
#[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
1409
1407
#[ allow( missing_docs) ]
1410
1408
pub macro offset_of ( $Container: ty, $( $fields: tt) . + $( , ) ?) {
0 commit comments