Skip to content

Commit cbb36d8

Browse files
committed
added column number to dbg!()
1 parent 1c15b82 commit cbb36d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/std/src/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,15 @@ macro_rules! dbg {
355355
// `$val` expression could be a block (`{ .. }`), in which case the `eprintln!`
356356
// will be malformed.
357357
() => {
358-
$crate::eprintln!("[{}:{}]", $crate::file!(), $crate::line!())
358+
$crate::eprintln!("[{}:{}:{}]", $crate::file!(), $crate::line!(), $crate::column!())
359359
};
360360
($val:expr $(,)?) => {
361361
// Use of `match` here is intentional because it affects the lifetimes
362362
// of temporaries - https://stackoverflow.com/a/48732525/1063961
363363
match $val {
364364
tmp => {
365-
$crate::eprintln!("[{}:{}] {} = {:#?}",
366-
$crate::file!(), $crate::line!(), $crate::stringify!($val), &tmp);
365+
$crate::eprintln!("[{}:{}:{}] {} = {:#?}",
366+
$crate::file!(), $crate::line!(), $crate::column!(), $crate::stringify!($val), &tmp);
367367
tmp
368368
}
369369
}

0 commit comments

Comments
 (0)