Open
Description
Today if a path refers to unnamed defs such as closures, it's printed using double braces e.g. for the following example, rustc
refers to Foo
as main::{{closure}}#0::Foo
:
fn main() {
|| {
struct Foo;
let () = Foo;
// ^^ expected struct `main::{{closure}}#0::Foo`, found `()`
}
}
However, the new Rust Symbol Mangling (rust-lang/rfcs#2603 / #60705), uses {closure#0}
instead.
I forget if I wrote about this before, but I prefer the newer form and it would be nice if we could switch everything uniformly to it.
As an aside, I've long believed that the double braces (e.g. {{closure}}
, {{impl}}
) were meant to be single braces (i.e. {closure}
, {impl}
), escaped for format!
, and that somehow that got lost.