1
Fork 0

Stabilize simple offset_of

This commit is contained in:
George Bateman 2023-12-05 22:15:26 +00:00
parent 88189a71e4
commit 615946db4f
No known key found for this signature in database
GPG key ID: C417AA9C4039EFCF
30 changed files with 134 additions and 49 deletions

View file

@ -3,7 +3,7 @@ Invalid argument for the `offset_of!` macro.
Erroneous code example:
```compile_fail,E0795
#![feature(offset_of, offset_of_enum)]
#![feature(offset_of_enum, offset_of_nested)]
let x = std::mem::offset_of!(Option<u8>, Some);
```
@ -16,7 +16,7 @@ The offset of the contained `u8` in the `Option<u8>` can be found by specifying
the field name `0`:
```
#![feature(offset_of, offset_of_enum)]
#![feature(offset_of_enum, offset_of_nested)]
let x: usize = std::mem::offset_of!(Option<u8>, Some.0);
```