From 634366f5fae6ff37342f37ec22bd3c29d312e2cf Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 19 Jul 2024 09:50:00 -0400 Subject: [PATCH] squelch final warnings --- examples/calc/ir.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/calc/ir.rs b/examples/calc/ir.rs index f1606852..8767cc6f 100644 --- a/examples/calc/ir.rs +++ b/examples/calc/ir.rs @@ -97,6 +97,7 @@ pub struct Span<'db> { // ANCHOR: diagnostic #[salsa::accumulator] +#[allow(dead_code)] // Debug impl uses them #[derive(new)] pub struct Diagnostic { pub start: usize, @@ -106,6 +107,7 @@ pub struct Diagnostic { // ANCHOR_END: diagnostic impl Diagnostic { + #[cfg(test)] pub fn render(&self, db: &dyn crate::Db, src: SourceProgram) -> String { use annotate_snippets::*; let line_start = src.text(db)[..self.start].lines().count() + 1;