Skip to content

[v0.4] RT-04: blank only test items, never the code after a cfg(test) that is not on an item (follow-up to #156) #169

Closed

Description

@humuhumu33

Follow-up to #156 (review comment of 2026-10-17, #156 (comment)). without_test_items (crates/conformance/src/cases/runtime.rs:582-636) assumes every #[cfg(test)] is on an item. It ends the item at the first ; or { at nesting 0 after the attribute, and does not stop at a } that closes the enclosing scope. It also blanks the whole file when #![cfg(test)] appears anywhere. A runtime text after a struct with a #[cfg(test)] field, after an enum with a #[cfg(test)] variant, inside a function with a #[cfg(test)] parameter, in a match arm after a #[cfg(test)] arm, or anywhere in a file holding mod m { #![cfg(test)] }, passes conformance_rt_04. Nothing is hidden on main today: every #[cfg(test)] in crates/lexlean/src is on a mod.

Definition of done:

  • A #[cfg(test)] blanks only when, after further outer attributes and a visibility, it is followed by an item keyword (mod, fn, use, impl, const, static, struct, enum, type, trait, macro_rules!). Otherwise nothing is blanked, and the code is read.
  • The scan for an item's end stops at a } or , at nesting 0 that closes the enclosing scope.
  • #![cfg(test)] blanks a file only as one of its leading inner attributes, before any item.
  • rt_04 plants each shape in memory (field, variant, parameter, match arm, inline mod with #![cfg(test)]), each followed by a runtime text, and asserts each is found once.
  • One shape is planted on the committed tree and recorded in VERIFICATION.md with its output.
  • The base tree still reports only backend/core_v2.rs. No new row, no new diagnostic code, just vv green.
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions