diff options
| author | darklyspaced <srohanjd@gmail.com> | 2023-08-18 18:24:22 +0800 |
|---|---|---|
| committer | darklyspaced <srohanjd@gmail.com> | 2023-12-12 18:12:23 +0800 |
| commit | cbb36d808bfa118987bdf005495eba8aa23e2daa (patch) | |
| tree | 8a49f263d0dc3d2f842fa4df6bc27b20ba5037d9 | |
| parent | 1c15b82b8a3c6fc36cf0f20bbf33a2e316be1e80 (diff) | |
| download | rust-cbb36d808bfa118987bdf005495eba8aa23e2daa.tar.gz rust-cbb36d808bfa118987bdf005495eba8aa23e2daa.zip | |
added column number to dbg!()
| -rw-r--r-- | library/std/src/macros.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 34b8b6b97b5..58df83bd79d 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -355,15 +355,15 @@ macro_rules! dbg { // `$val` expression could be a block (`{ .. }`), in which case the `eprintln!` // will be malformed. () => { - $crate::eprintln!("[{}:{}]", $crate::file!(), $crate::line!()) + $crate::eprintln!("[{}:{}:{}]", $crate::file!(), $crate::line!(), $crate::column!()) }; ($val:expr $(,)?) => { // Use of `match` here is intentional because it affects the lifetimes // of temporaries - https://stackoverflow.com/a/48732525/1063961 match $val { tmp => { - $crate::eprintln!("[{}:{}] {} = {:#?}", - $crate::file!(), $crate::line!(), $crate::stringify!($val), &tmp); + $crate::eprintln!("[{}:{}:{}] {} = {:#?}", + $crate::file!(), $crate::line!(), $crate::column!(), $crate::stringify!($val), &tmp); tmp } } |
