Skip to content

Printing of closure types and MIR closure constructors #66869

Open
@oli-obk

Description

@oli-obk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-closuresArea: Closures (`|…| { … }`)A-prettyArea: Pretty printing (including `-Z unpretty`)C-enhancementCategory: An issue proposing an enhancement or a PR with one.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

    No branches or pull requests

    Issue actions