Skip to content

Commit 9425208

Browse files
committed
explain that the unaligned_field_offset intrinsic is const-only
1 parent 9097c31 commit 9425208

File tree

1 file changed

+8
-1
lines changed
  • library/core/src/intrinsics

1 file changed

+8
-1
lines changed

library/core/src/intrinsics/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3315,7 +3315,14 @@ pub unsafe fn va_arg<T: VaArgSafe>(ap: &mut VaListImpl<'_>) -> T;
33153315
#[rustc_nounwind]
33163316
pub unsafe fn va_end(ap: &mut VaListImpl<'_>);
33173317

3318-
/// `offset_of!` for `UnalignedField` trait.
3318+
/// `offset_of!` for field representing types.
3319+
///
3320+
/// Returns the offset of the field represented by `F`.
3321+
///
3322+
/// Expects the generic `F` to be a field representing type expressed using
3323+
/// [`field_of!`](core::field::field_of).
3324+
///
3325+
/// This is a `const`-only intrinsic that doesn't have any codegen.
33193326
#[rustc_intrinsic]
33203327
#[lang = "unaligned_field_offset"]
33213328
#[unstable(feature = "field_projections", issue = "145383")]

0 commit comments

Comments
 (0)