Skip to content

Tracking issue for RFC 2361, "Simpler alternative dbg!() macro" #54306

Closed
@Centril

Description

@Centril
Contributor

This is a tracking issue for the RFC "Simpler alternative dbg!() macro" (rust-lang/rfcs#2361).

Steps:

Unresolved questions:

There are none.

Activity

added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Sep 17, 2018
self-assigned this
on Sep 17, 2018
Centril

Centril commented on Sep 17, 2018

@Centril
ContributorAuthor

I am working on this :)

added
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Sep 18, 2018
yoshuawuyts

yoshuawuyts commented on Sep 25, 2018

@yoshuawuyts
Member

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. JS console.log(x, y), Rust println!("{:?}, {:?}", x, y), Bash echo $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

let x = 1;
let y = 2;
dbg!(x, y);

Current

let x = 1;
let y = 2;
dbg!(x);
dbg!(y);
SimonSapin

SimonSapin commented on Sep 25, 2018

@SimonSapin
Contributor

I suppose one alternative to the tuple discontinuity could be to return nothing at all when more than one argument is provided.

Centril

Centril commented on Sep 25, 2018

@Centril
ContributorAuthor

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.

added
B-unstableBlocker: Implemented in the nightly compiler and unstable.
on Sep 25, 2018

42 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @alexreg@SimonSapin@oli-obk@Centril@yoshuawuyts

      Issue actions

        Tracking issue for RFC 2361, "Simpler alternative dbg!() macro" · Issue #54306 · rust-lang/rust