Skip to main content

module_file

Function module_file 

fn module_file<'a>(
    files: &BTreeMap<&str, &'a SourceFile>,
    scope: &str,
) -> Option<&'a SourceFile>
Expand description

The source file a module scope’s items are written in.

Three spellings, and the third is easy to forget: a module is <scope>.rs or <scope>/mod.rs, and a crate root is <scope>/lib.rs. Omitting the last one leaves every crate root childless, which silently empties Sources::public_scopes and turns every same-crate re-export into an inlined one.