Skip to content

ty::print::pretty's p! macro should support string literals. #70948

@eddyb

Description

@eddyb
Member

E.g. printing ty::Slice(ty) uses:

p!(write("["), print(ty), write("]"))

but we could allow writing it like this, by letting the macro use $...:literal:

p!("[", print(ty), "]")

But I'm not sure the macro can handle it easily.

Maybe we should just have Print implemented for more types and just make p!(a, b, c) print a, b and c (and we can then rename it to print!).

This issue has been assigned to @jakevossen5 via this comment.

Activity

added
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Apr 9, 2020
jakevossen5

jakevossen5 commented on Apr 11, 2020

@jakevossen5
Contributor

@rustbot claim

self-assigned this
on Apr 11, 2020
Alexendoo

Alexendoo commented on Aug 5, 2020

@Alexendoo
Member

Hi @jakevossen5, are you still working on this issue?

jakevossen5

jakevossen5 commented on Aug 5, 2020

@jakevossen5
Contributor

So sorry for the lack of communication on this. I am, have gotten a bit busy this summer but have some stuff wrapping up and hope to get it done soon. If this is blocking or causing problems, then someone else can take it but if not I would still like to work on this.

Alexendoo

Alexendoo commented on Aug 5, 2020

@Alexendoo
Member

No problem @jakevossen5, it's not blocking anything I'm just checking claimed issues to see if people are still interested in working on them

added a commit that references this issue on Oct 4, 2020
44ce38a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-prettyArea: Pretty printing (including `-Z unpretty`)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @eddyb@jonas-schievink@Alexendoo@jakevossen5@rustbot

    Issue actions

      ty::print::pretty's p! macro should support string literals. · Issue #70948 · rust-lang/rust