Skip to content

rust: owner-pin precision gaps left by #6909 (nested src/bin targets, path-qualified inline receivers, explicit-return tails) #6916

Open

Description

@EffortlessSteven

Three under-credit gaps declined in review of #6909 (#5352). Each one fails closed today: the result is a refusal or a missing pin, never a wrong exposed. They hurt the goal that verdicts be trustworthy without needless refusals.

  1. Nested binary targets. TargetRoots::root recognizes src/bin/*.rs but not src/bin/<name>/main.rs. A crate-local macro site in such a binary, such as #[macro_use] extern crate bencher;, stays workspace-wide and refuses tests/*.rs assertions in the library.

    • Repro: add src/bin/tool/main.rs containing #[macro_use]\nextern crate bencher; beside a library whose tests/t.rs asserts assert_eq!(weight(4), 12). The result is a MacroBinding refusal.
    • Fix: recognize the target, and compose src/bin/<name>/*.rs modules under it so they do not look like roots of their own.
  2. Path-qualified inline receivers. crate::Stack::new().pop() and a::B::new().m() are not typed as a constructed receiver. Only the single-segment T::ctor(..) form is.

    • Constraint: change this together with the let x = path::T::new() binding typing so the two forms stay in parity.
  3. Explicit-return tails. An early return None; in a function that ends with return Some(x); (an empty tail) is not pinned.

    • Constraint: an empty tail after a trailing block such as loop { break None } or if .. { .. } else { None } hides a second source. Only an explicit final return <head>(..); statement could be admitted.

Owner: trustworthy-verdicts thread (Rust owner-pin admission, RIPR-SPEC-0197).

Activity

  1. EffortlessSteven commented on Nov 2, 2026

    @EffortlessSteven
    MemberAuthor

    Cursor claim: verifying #6916 against main, then fixing if still open.

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