Skip to main content

resolve_next

Function resolve_next 

Source
pub fn resolve_next(
    name: &str,
    origin: &Origin,
    current: Option<&Entry>,
    paths: &SearchPaths,
) -> Result<Resolved, Error>
Expand description

#include_next <name>: the same search, taken up again at the entry after the one the file writing the directive was found under.

GCC’s semantics exactly, and the reason the directive exists: a platform’s <limits.h> finishes with #include_next <limits.h> to reach the next limits.h on the path rather than itself. current is Resolved::found_in of the file the directive is written in; a file that was not found by a search at all — the unit’s own text, or a header taken from the including file’s directory — has no entry to go on from, and GCC starts such a search at the beginning, which is what None does here.

The quoted and the angled forms mean the same thing, as they do in GCC: the including file’s own directory is never step one of an #include_next.