Skip to main content

wrappers_semantically_equal

Function wrappers_semantically_equal 

Source
fn wrappers_semantically_equal(a: &str, b: &str) -> bool
Expand description

Returns true when a and b are equal after normalising away (<file>.rs:LINE:COL) positional suffixes in source-attribution comments.

The #[miniextendr] proc-macro emits comments of the form:

# Generated from Rust fn `foo` (lib.rs:42:8)

The 42:8 part shifts whenever unrelated code above the wrapper is edited, producing spurious wrapper-file rewrites and misleading NOTEs. Normalisation replaces (lib.rs:42:8)(lib.rs:_:_) for the comparison only; the file on disk still carries the real positions.

A match requires ( + one or more non-()/non-newline chars + .rs: + ASCII digits + : + ASCII digits + ). Malformed or non-.rs patterns are left untouched.