Closed
Description
This is a tracking issue for the RFC "Simpler alternative dbg!()
macro" (rust-lang/rfcs#2361).
Steps:
- Implement the RFC: Implement the dbg!(..) macro #54317Adjust documentation (see instructions on forge)Stabilization PR (see instructions on forge)
Unresolved questions:
There are none.
Metadata
Metadata
Assignees
Labels
Blocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCRelevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Centril commentedon Sep 17, 2018
I am working on this :)
yoshuawuyts commentedon Sep 25, 2018
I just tried this out, and something that was unexpected for me was that it
dbg!()
can only take a single value. I think this might be because most other printers I've used to this point support this (e.g. JSconsole.log(x, y)
, Rustprintln!("{:?}, {:?}", x, y)
, Bashecho $x $y
).I didn't see this mentioned in the RFC anywhere, but it's possible this was brought up before and now falls under "Unbounded bikeshedding". I don't know if it does, but figured it might be worth sharing my experience in the off chance this hadn't been brought up before.
edit (2018-09-25): I just re-read the proposal and found the
tuples
entry. I guess that answers it, but yeah it still was something unexpected to me. Ah well.Expected
Current
SimonSapin commentedon Sep 25, 2018
I suppose one alternative to the tuple discontinuity could be to return nothing at all when more than one argument is provided.
Centril commentedon Sep 25, 2018
The original RFC, rust-lang/rfcs#2173, considered it and dealt with this by giving you back a tuple; e.g.
dbg!(a, b, c) : (typeof(a), typeof(b), typeof(c))
. If we're going to support multiple arguments then I think that is the natural approach. Not returning anything would be surprising imo.42 remaining items