aboutsummaryrefslogtreecommitdiff
path: root/src/span_of.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/span_of.rs')
-rw-r--r--src/span_of.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/span_of.rs b/src/span_of.rs
index a3663d5..c2030b7 100644
--- a/src/span_of.rs
+++ b/src/span_of.rs
@@ -52,11 +52,18 @@ macro_rules! _memoffset__compile_error {
/// span_of!(Struct, start ..)
/// ```
///
-/// *Note*:
+/// ### Note
/// This macro uses recursion in order to resolve the range expressions, so there is a limit to
/// the complexity of the expression.
/// In order to raise the limit, the compiler's recursion limit should be lifted.
///
+/// ### Safety
+/// The inter-field form mentioned above assumes that the first field is positioned before the
+/// second.
+/// This is only guarenteed for `repr(C)` structs.
+/// Usage with `repr(Rust)` structs may yield unexpected results, like downward-going ranges,
+/// spans that include unexpected fields, empty spans, or spans that include *unexpected* padding bytes.
+///
/// ## Examples
/// ```
/// use memoffset::span_of;