361. One trait-satisfaction relation: records by shape, structs by impl (2026-11-23)
Spec's review of stdlib's decision 359 (if A: Trait holds by shape). The
idea is R08.1.7 already: records satisfy field traits structurally. But the
implementation made two relations: if A: HasW was false for a record that
A: HasW accepted, and if A: Named was true for a struct with a name
field that A: Named rejected (E0606). Now one relation decides a bound, a
parameter typed by a trait and if T: Trait: a record or tuple satisfies a
trait when a field meets every member the trait leaves without a body; a
named struct only through an impl, which may be bodiless when its fields
meet them. A bodiless @get fn w(self) -> W is the same requirement as a
field w: W, so std's getter traits and the spec's field traits are one
concept. Records are structural already (rows, derived +), so a record
meeting a trait by accident is no new surprise; structs keep their fields
private (R11.1.4) and opt in. Not a change of the language's character.
Cases core-08/if-bound-*, core-08/getter-trait-struct-opt-in. Reverse:
let structs satisfy by shape too, or drop shape satisfaction from
if T: Trait (then arc_len needs Graph arcs to impl Weighted).