INNER CODE UNIT · Rust

line_no

stjude-rust-labs/sprocket · crates/gauntlet/src/lib.rs:285

                    let line_no = file.line_index((), byte_start).unwrap_or_default() + 1;
                    let message = std::str::from_utf8(buffer.as_slice())
                        .context("diagnostic should be UTF-8")?
                        .trim()
                        .to_string();

                    // Normalize the diagnostic message to handle
                    // platform-specific differences
                    let message = normalize_diagnostic(&message);

                    if !actual.insert((message.clone(), line_no)) {
                        panic!(
                            "duplicate diagnostic: `{message}` at {path}:{line_no}",
                            path = document_identifier.path()
                        );
                    }
                }
            }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…