Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printing of closure types and MIR closure constructors #66869

Open
oli-obk opened this issue Nov 29, 2019 · 1 comment
Open

Printing of closure types and MIR closure constructors #66869

oli-obk opened this issue Nov 29, 2019 · 1 comment
Labels
A-closures Area: Closures (`|…| { … }`) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing (including `-Z unpretty`) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Nov 29, 2019

Quoting @eddyb in #66850 (comment)

I'm not that happy with [closure@PATH::{{closure}}#n ...], but it's consistent with what we have so far, if we want to go further I'd prefer something like this:

foo<T>::{closure#0} { q:&i32, t:&T }

(yes, {{closure}}#n -> {closure#n} is a change we should do eventually, IMO)
and without -Z span_free_formats we could perhaps go for:

closure(src/main.rs:10:13) { q:&i32, t:&T }

(and we need to remember to fix generators as well)

Oh and we could also change fn definition types from:

fn(bool) -> bool {std::convert::identity::<bool>}

to:

fn std::convert::identity::<bool>(bool) -> bool
@oli-obk oli-obk added A-pretty Area: Pretty printing (including `-Z unpretty`) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels Nov 29, 2019
@jonas-schievink jonas-schievink added A-closures Area: Closures (`|…| { … }`) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 29, 2019
@eddyb eddyb changed the title Printing of closure types in MIR Printing of closure types and MIR closure constructors Nov 29, 2019
@arora-aman
Copy link
Member

If I understand correctly First part implemented here: #76176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-pretty Area: Pretty printing (including `-Z unpretty`) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants