diff options
| author | bors <bors@rust-lang.org> | 2017-12-27 07:11:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-12-27 07:11:50 +0000 |
| commit | 3fd27b2718438ceec6243869cde3edde7e5a904e (patch) | |
| tree | 500df19b7e797341a03aedf5d9934f5c026cd6f2 /src/libstd | |
| parent | e8098c5c4db081585e0dc12fe6a2e0defe92857f (diff) | |
| parent | 6081989adc7e06dcb6b88feb12908dbb08565c6c (diff) | |
| download | rust-3fd27b2718438ceec6243869cde3edde7e5a904e.tar.gz rust-3fd27b2718438ceec6243869cde3edde7e5a904e.zip | |
Auto merge of #46977 - est31:column_fix, r=dtolnay
Make the output of the column! macro 1 based Fixes #46868. I didn't add any regression tests as the change already had to change tests inside the codebase. r? @dtolnay
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/macros.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index de46fedaebb..9f3f0ea2742 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 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. /// /// [`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 |
