Skip to content

Rust adapter: byte and C raw strings (br"\", cr"\") hide includes and #[path] from the input scan #220

Closed

Description

@FredApps

The Rust adapter's input scan (rustInputs in src/repo/adapters/rust.ts) knows raw strings (r"…", r#"…"#), but not byte or C raw strings (br"…", cr"…", br#"…"#). It reads br"\" as the identifier br and then an ordinary string, so the backslash escapes the closing quote and the string runs on into the next lines. Anything in that stretch is never seen, including a computed include! or a #[path] attribute that should force a full run.

This fails open: the crate gets no blocker and no edge, so a change to the file it really loads can skip its tests.

Repro (compiles with rustc; crates/a/src/lib.rs in a two-crate workspace with a and b):

pub const P: &[u8] = br"\";
#[path = "../../b/src/lib.rs"] mod external;
// "

rustAdapter.analyze reports no blockers. With r"\" instead of br"\" it correctly reports Rust computed includes or path attributes require full validation. The same happens with cr"\", br#"…"# and cr#"…"#, and with include!(concat!(env!("OUT_DIR"), "/generated.rs")) in place of the #[path].

This isn't only synthetic. Windows path crates use br"\" a lot: typed-path has it in code and doctests on almost every line of src/windows/non_utf8/components/component.rs.

Fix: let the raw-string branch take an optional b or c prefix. No other change is needed, because the identifier branch runs after it.

Activity

  1. changed the title [-]Rust adapter: byte and C raw strings (br"\\", cr"\\") hide includes and #[path] from the input scan[/-] [+]Rust adapter: byte and C raw strings (br"\", cr"\") hide includes and #[path] from the input scan[/+] on Nov 17, 2026
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