@@ -1303,11 +1303,12 @@ impl<T> SizedTypeProperties for T {}
13031303/// Enum variants may be traversed as if they were fields. Variants themselves do
13041304/// not have an offset.
13051305///
1306+ /// However, on stable only a single field name is supported, which blocks the use of
1307+ /// enum support.
1308+ ///
13061309/// Visibility is respected - all types and fields must be visible to the call site:
13071310///
13081311/// ```
1309- /// #![feature(offset_of)]
1310- ///
13111312/// mod nested {
13121313/// #[repr(C)]
13131314/// pub struct Struct {
@@ -1330,8 +1331,6 @@ impl<T> SizedTypeProperties for T {}
13301331/// not *identical*, e.g.:
13311332///
13321333/// ```
1333- /// #![feature(offset_of)]
1334- ///
13351334/// struct Wrapper<T, U>(T, U);
13361335///
13371336/// type A = Wrapper<u8, u8>;
@@ -1359,8 +1358,7 @@ impl<T> SizedTypeProperties for T {}
13591358/// # Examples
13601359///
13611360/// ```
1362- /// #![feature(offset_of)]
1363- /// # #![feature(offset_of_enum)]
1361+ /// #![feature(offset_of_enum, offset_of_nested)]
13641362///
13651363/// use std::mem;
13661364/// #[repr(C)]
@@ -1396,15 +1394,15 @@ impl<T> SizedTypeProperties for T {}
13961394/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
13971395/// ```
13981396#[ cfg( not( bootstrap) ) ]
1399- #[ unstable ( feature = "offset_of" , issue = "106655 " ) ]
1397+ #[ stable ( feature = "offset_of" , since = "CURRENT_RUSTC_VERSION " ) ]
14001398#[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
14011399pub macro offset_of ( $Container: ty, $( $fields: expr) + $( , ) ?) {
14021400 // The `{}` is for better error messages
14031401 crate :: hint:: must_use ( { builtin # offset_of ( $Container, $( $fields) +) } )
14041402}
14051403
14061404#[ cfg( bootstrap) ]
1407- #[ unstable ( feature = "offset_of" , issue = "106655 " ) ]
1405+ #[ stable ( feature = "offset_of" , since = "CURRENT_RUSTC_VERSION " ) ]
14081406#[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
14091407#[ allow( missing_docs) ]
14101408pub macro offset_of ( $Container: ty, $( $fields: tt) . + $( , ) ?) {
0 commit comments