Almost. dbg! also shows the statement in addition to what it evaluates too. That is:
dbg!(n * factorial(n - 1))
shows up as: [src/main.rs:5] n * factorial(n - 1) = 2
[src/main.rs:5] n * factorial(n - 1) = 6
[src/main.rs:5] n * factorial(n - 1) = 24
Although, IIRC there was some crazy dumper module by dconway (who else) that worked similar to this, but I don't recall if it returned the value....
So, I just looked it up, and I found it. Actually, Damien wrote two. One that he updated from 2014 to 2016, and one he started in 2017 and has maintained to the present. I have no idea the reason for that.
Prints a YAML dump of "my str", followed by file/line number information, then returns its argument so it can be embedded in expressions:
Data::Dump's "ddx" (1996) is also commonly used for print debugging, except it doesn't return the argument.