Skip to main content

parse_location_line

Function parse_location_line 

Source
pub fn parse_location_line(line: &str) -> Option<CompilationLocation>
Expand description

CM.3b: parse a source location out of ONE *compilation* buffer line — the <CR>-jump seam. Runs the built-in rustc---> and gnu-style location regexes (the same compiled patterns the streaming parsers use, via [crate::parsers::match_location_line]) against the line and returns the first match, converting 1-based line/col to 0-based. None when the line carries no navigable location (progress, summary, backtraces, prose).

Deliberately independent of the streaming ParserRegistry’s pending multi-line state: stdout/stderr interleave in the buffer, so a buffer-line→entry map isn’t reliable. Parsing the cursor line directly is interleaving-proof and covers both the gnu lines and the cargo --> location line. CM.3c’s severity gutter decoration reuses this exact function.