Expand description
syn::Path matching helpers shared by capability-attr (call-path
detection for its allocation/IO/raw-pointer vocabulary) and
taint-check (sink/sanitizer call-path detection).
This crate is unpublished and has no design doc of its own: every
function here was a private, non-pub helper inside capability-attr’s
inspector.rs before this extraction, never reachable from outside
that crate — doubly so since a proc-macro = true crate can only
export its #[proc_macro_attribute] entry points to begin with. Moving
them here changes no public API of either dependent crate.
Functions§
- path_
has_ segment trueif any segment ofpathis exactlymarker.- path_
last_ segment - The trailing segment’s identifier, as a
String. - path_
last_ two - Join just the trailing one or two segments of
pathwith::, soVec::new()andstd::vec::Vec::new()both match the same"Vec::new"check regardless of how fully-qualified the call is written. - path_
to_ string - Join every segment of
pathwith::(e.g.std::fs::read_to_string).