Skip to content

Commit

Permalink
Document units for std::column
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Dec 27, 2021
1 parent 9b45f04 commit 3115d84
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions library/core/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,18 @@ pub(crate) mod builtin {
/// let current_col = column!();
/// println!("defined on column: {}", current_col);
/// ```
///
/// `column!` counts Unicode code points, not bytes or graphemes. As a result, the first two
/// invocations return the same value, but the third does not.
///
/// ```
/// let a = ("foobar", column!()).1;
/// let b = ("人之初性本善", column!()).1;
/// let c = ("f̅o̅o̅b̅a̅r̅", column!()).1; // Uses combining overline (U+0305)
///
/// assert_eq!(a, b);
/// assert_ne!(b, c);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_builtin_macro]
#[macro_export]
Expand Down

0 comments on commit 3115d84

Please sign in to comment.