about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2017-12-24 02:20:06 +0100
committerest31 <MTest31@outlook.com>2017-12-24 02:20:06 +0100
commite5c3aac0b482ea8b37787445cd4f73380c01e345 (patch)
tree92e3a6fabacf7b1fbc145530d90e2b2ada2ffc07 /src/libstd
parent16992930835ce3376a4aaed42307726e1fc78e45 (diff)
downloadrust-e5c3aac0b482ea8b37787445cd4f73380c01e345.tar.gz
rust-e5c3aac0b482ea8b37787445cd4f73380c01e345.zip
Make column macro output 1 based and document it
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/macros.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index de46fedaebb..1fed918f246 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -460,9 +460,12 @@ pub mod builtin {
     /// With [`column!`] and [`file!`], these macros provide debugging information for
     /// developers about the location within the source.
     ///
-    /// The expanded expression has type `u32`, and the returned line is not
-    /// the invocation of the `line!()` macro itself, but rather the first macro
-    /// invocation leading up to the invocation of the `line!()` macro.
+    /// The expanded expression has type `u32` and is 1-based, so the first line
+    /// in each file evaluates to 1, the second to 2, etc. This is consistent
+    /// with error messages by common compilers or popular editors.
+    /// The returned column is not the invocation of the `line!` macro itself,
+    /// but rather the first macro invocation leading up to the invocation
+    /// of the `line!` macro.
     ///
     /// [`column!`]: macro.column.html
     /// [`file!`]: macro.file.html
@@ -482,9 +485,12 @@ pub mod builtin {
     /// With [`line!`] and [`file!`], these macros provide debugging information for
     /// developers about the location within the source.
     ///
-    /// The expanded expression has type `u32`, and the returned column is not
-    /// the invocation of the `column!` macro itself, but rather the first macro
-    /// invocation leading up to the invocation of the `column!` macro.
+    /// The expanded expression has type `u32` and is 1-based, so the first column
+    /// in each line evaluates to 1, the second to 2, etc. This is consistent
+    /// with error messages by common compilers or popular editors.
+    /// The returned column is not the invocation of the `column!` macro itself,
+    /// but rather the first macro invocation leading up to the invocation
+    /// of the `column!` macro.
     ///
     /// [`line!`]: macro.line.html
     /// [`file!`]: macro.file.html