You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
§15.4.7 says :? is 'available for all types', but fn values, closures, dyn Trait, ranges and va_list have no Debug form; Rc/Arc/HashSet's generated form prints raw addresses #1564
Surfaced by the D61 implementation (#1480). The table and the D61 text define a form for numbers, bool, str, structs, enums, Option/Result, Vec/array/slice, HashMap and BTreeMap; the text says every other type uses the generated (structural) form.
What the implementation does today:
a fn value, closure, dyn Trait, range or va_list under :? is a compile error naming the type (cannot format a value of type ... with :? — §15.4.7 gives it no Debug form) — no placeholder, per the no-silent-fallback rule; a Result whose Err type has no form still unwraps, its panic message just omits the payload.
a raw pointer prints its address (decimal, as emit-c already did; the LLVM backend used to read it as a C string).
Rc[T], Arc[T], HashSet[T], Handle[T] and other std handles print their generated struct form, which is a raw address (HashSet { ptr: 4298... }): not a placeholder, but not useful and not run-stable.
Box[T] is transparent (formats its payload), which the table does not say either; it is what recursion through Box needs and what Rust does.
A ruling is needed on: (a) whether Available for all types should hold for fn/dyn/range (and with what text), (b) rows for sets and the reference-counted pointers (Rust: {a, b} and transparent), (c) confirming Box transparency. Until then the D61 implementation errors on the first group and prints the generated form for the second.
Activity
Spec: :? rows for HashSet/Box/Rc/Arc/raw pointers (#1564); two D71 dr…
D71 language rulings: @[flags] without repr, from_int on unit enums, …