Skip to content

exclude_re on external modules does not apply inside module files #633

Description

@P4suta

#[mutants::exclude_re("...")] works on an inline module, but the same
attribute on mod external; does not apply inside external.rs.

// src/lib.rs
#[mutants::exclude_re("replace skipped")]
mod external;
// src/external.rs
pub fn skipped() -> bool {
    true
}

pub fn retained() -> bool {
    true
}

cargo mutants --list still includes the function-value mutant for
external::skipped. Moving the same module body inline excludes it as
expected.

The active patterns are kept while visiting one syntax tree, but are not
carried with an external-module reference into the referenced file. Module
scope should be independent of whether the module is inline or stored in
another file, including across nested external modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions