Skip to content

Constructed field pinned by a whole-value derived-PartialEq literal reads weakly_exposed #15345

Closed

Description

@EffortlessSteven

Found while testing ripr on macro-heavy Rust (derives). Owner on main 332729a. Related: RIPR-SPEC-0225 / #7066, #6692.

Wrong verdict: a constructed field checked by a whole-value assert_eq! against a derived-PartialEq literal that names the field reads weakly_exposed, while the return-value probe on the same line reads exposed.

#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct Cfg { pub retries: u32, pub verbose: bool }
impl Cfg {
    pub fn new() -> Self { Cfg { retries: 4, verbose: false } }   // was retries: 3
}
#[test]
fn defaults() { assert_eq!(Cfg::new(), Cfg { retries: 3, verbose: false }); }
  • Observed (field_construction probe): weakly_exposed, "no field-value assertion observes the constructed field", "uses strong whole object equality oracle ... misses: no assertion pins retries: 4".
  • Expected: exposed; the whole-value literal names retries with a value that differs from head, and PartialEq is derived, so the test fails on head.

Generated by Claude Code

Activity

  1. added
    status/needs-work
    on Nov 19, 2026
  2. EffortlessSteven commented on Nov 19, 2026

    @EffortlessSteven
    MemberAuthor

    Claim: taking this. Branch claude/project-thread-8doc7v, PR to follow. The same split shows in the rust_returned_type_drop_alias_plain fixture from #15179 (field weakly_exposed, return value exposed).


    Generated by Claude Code

  3. EffortlessSteven commented on Nov 20, 2026

    @EffortlessSteven
    MemberAuthor

    Landed in #15438 (2a545ec). An associated constructor's whole-value literal now pins its field through the T::name(..) call identity, and a literal neither version computes stays weakly_exposed (control fixture rust_whole_value_associated_constructor_unpinned_field).


    Generated by Claude Code

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

    bugfinding-qualityimplementation-slicestatus/needs-worktestingtooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions