Skip to main content

visible_macros

Function visible_macros 

Source
pub fn visible_macros<'a, S: BuildHasher>(
    file: &Path,
    files: &'a HashMap<PathBuf, PreprocFile, S>,
) -> HashSet<&'a str>
Expand description

Every macro name visible to file — its own #defines plus those of every header it transitively includes — borrowed from files.

The crate-internal form of get_macros, which owns the same names only because its HashSet<String> return type is published. Callers inside the crate just probe the result with contains, so borrowing suffices (issue #1107). Still a merged set and not a list of per-file sets to probe in turn, because it is consulted once per identifier run in the whole translation unit: an O(headers) probe would cost far more than the one-off merge it saves.