Skip to content

Commit

Permalink
Document const-ness of transmute(_*)! macros (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
jswrenn committed Mar 5, 2024
1 parent 2a787c1 commit 06a6bde
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4332,6 +4332,10 @@ mod simd {
///
/// assert_eq!(two_dimensional, [[0, 1, 2, 3], [4, 5, 6, 7]]);
/// ```
///
/// # Use in `const` contexts
///
/// This macro can be invoked in `const` contexts.
#[macro_export]
macro_rules! transmute {
($e:expr) => {{
Expand Down Expand Up @@ -4400,6 +4404,10 @@ macro_rules! transmute {
/// assert_eq!(two_dimensional, &[[0, 1, 2, 3], [4, 5, 6, 7]]);
/// ```
///
/// # Use in `const` contexts
///
/// This macro can be invoked in `const` contexts.
///
/// # Alignment increase error message
///
/// Because of limitations on macros, the error message generated when
Expand Down Expand Up @@ -4530,6 +4538,10 @@ macro_rules! transmute_ref {
/// assert_eq!(one_dimensional, [4, 5, 6, 7, 0, 1, 2, 3]);
/// ```
///
/// # Use in `const` contexts
///
/// This macro can be invoked in `const` contexts.
///
/// # Alignment increase error message
///
/// Because of limitations on macros, the error message generated when
Expand Down Expand Up @@ -4691,6 +4703,10 @@ macro_rules! transmute_mut {
/// assert_eq!(as_i32, i32::from_ne_bytes([b'a', b'b', b'c', b'd']));
/// }
/// ```
///
/// # Use in `const` contexts
///
/// This macro can be invoked in `const` contexts.
#[doc(alias("include_bytes", "include_data", "include_type"))]
#[macro_export]
macro_rules! include_value {
Expand Down

0 comments on commit 06a6bde

Please sign in to comment.