File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1395,8 +1395,18 @@ impl<T> SizedTypeProperties for T {}
1395
1395
///
1396
1396
/// assert_eq!(mem::offset_of!(Option<&u8>, Some.0), 0);
1397
1397
/// ```
1398
+ #[ cfg( not( bootstrap) ) ]
1398
1399
#[ unstable( feature = "offset_of" , issue = "106655" ) ]
1399
1400
#[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
1401
+ pub macro offset_of ( $Container: ty, $( $fields: expr) + $( , ) ?) {
1402
+ // The `{}` is for better error messages
1403
+ crate :: hint:: must_use ( { builtin # offset_of ( $Container, $( $fields) +) } )
1404
+ }
1405
+
1406
+ #[ cfg( bootstrap) ]
1407
+ #[ unstable( feature = "offset_of" , issue = "106655" ) ]
1408
+ #[ allow_internal_unstable( builtin_syntax, hint_must_use) ]
1409
+ #[ allow( missing_docs) ]
1400
1410
pub macro offset_of ( $Container: ty, $( $fields: tt) . + $( , ) ?) {
1401
1411
// The `{}` is for better error messages
1402
1412
crate :: hint:: must_use ( { builtin # offset_of ( $Container, $( $fields) . +) } )
You can’t perform that action at this time.
0 commit comments