Skip to main content

write_msvc_warning

Function write_msvc_warning 

Source
pub fn write_msvc_warning<W: Write>(
    offenders: &[OffenderRecord],
    writer: W,
) -> Result<()>
Expand description

Write MSVC-style warning lines for offenders to writer.

Format: {path}({line},{col}): {severity} : {message}, terminated by \n. Note the space before the colon after severity — that is the MSVC convention. On Windows the path uses \ separators (matching cl.exe output); on other platforms it is emitted as-is. Non-UTF-8 paths are skipped with a stderr warning. An empty offenders slice writes nothing.

§Errors

Returns any io::Error produced by writer while emitting a warning line. Stops at the first error; partially-written output may have reached the writer before the failure.