Skip to content

stdlib: print(usize) fails its Display bound although interpolation supports it #1673

Closed

Description

@ehartford

Found while testing D64's usize copy-back result. This reproduces on the installed, verified main compiler (334739d, SHA-256 88b438898e344e8e1caa73bd4359e48ed21189a99e6de4f774e8157ed44011ef), independently of the modeled-C changes:

fn main: print(1 as usize)

with check exits 1:

type 'usize' does not implement trait 'Display' required by bound 'T: Display'
unknown method 'to_str' for type '&usize'

print at lib/std/builtins.w:36 requires Display and calls v.to_str() at line 40. The primitive Display registrations in lib/std/traits.w:262-273 list the fixed-width numeric types but omit usize/isize. The surrounding comment promises parity with string interpolation; existing D64 fixtures successfully interpolate usize results. Please cover both pointer-sized integer types and direct/interpolated formatting parity across targets.

Filed separately per the handoff's instruction to keep unrelated defects from displacing the modeled-C batch. The bounds regression uses interpolation, matching the existing byte-buffer bounds fixture; its actual contract failure remains asserted.

Activity

  1. ehartford commented on Sep 26, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by #1702 (55739d4); battery green, pinned by the behavior tests named in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions