diff --git a/benches/compare.rs b/benches/compare.rs index 7c82881ff..3a1d6bb76 100644 --- a/benches/compare.rs +++ b/benches/compare.rs @@ -26,7 +26,7 @@ pub struct InternedInput<'db> { pub text: String, } -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::Supertype)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, salsa::Supertype)] enum SupertypeInput<'db> { InternedInput(InternedInput<'db>), Input(Input), diff --git a/components/salsa-macro-rules/src/setup_input_struct.rs b/components/salsa-macro-rules/src/setup_input_struct.rs index 7274697fd..eeac7deb3 100644 --- a/components/salsa-macro-rules/src/setup_input_struct.rs +++ b/components/salsa-macro-rules/src/setup_input_struct.rs @@ -223,7 +223,12 @@ macro_rules! setup_input_struct { } /// Default debug formatting for this struct (may be useful if you define your own `Debug` impl) - pub fn default_debug_fmt(this: Self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + pub fn default_debug_fmt(this: Self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result + where + // rustc rejects trivial bounds, but it cannot see through higher-ranked bounds + // with its check :^) + $(for<'__trivial_bounds> $field_ty: std::fmt::Debug),* + { $zalsa::with_attached_database(|db| { let fields = $Configuration::ingredient(db).leak_fields(db, this); let mut f = f.debug_struct(stringify!($Struct)); diff --git a/components/salsa-macro-rules/src/setup_tracked_struct.rs b/components/salsa-macro-rules/src/setup_tracked_struct.rs index 8a448380e..1e16cc22d 100644 --- a/components/salsa-macro-rules/src/setup_tracked_struct.rs +++ b/components/salsa-macro-rules/src/setup_tracked_struct.rs @@ -286,9 +286,18 @@ macro_rules! setup_tracked_struct { ) } )* + } + impl<'_db> $Struct<'_db> { /// Default debug formatting for this struct (may be useful if you define your own `Debug` impl) - pub fn default_debug_fmt(this: Self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + pub fn default_debug_fmt(this: Self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result + where + // `zalsa::with_attached_database` has a local lifetime for the database + // so we need this function to be higher-ranked over the db lifetime + // Thus the actual lifetime of `Self` does not matter here so we discard + // it with the `'_db` lifetime name as we cannot shadow lifetimes. + $(for<$db_lt> $field_ty: std::fmt::Debug),* + { $zalsa::with_attached_database(|db| { let fields = $Configuration::ingredient(db).leak_fields(db, this); let mut f = f.debug_struct(stringify!($Struct)); diff --git a/components/salsa-macros/src/accumulator.rs b/components/salsa-macros/src/accumulator.rs index 2885e131b..872622f7b 100644 --- a/components/salsa-macros/src/accumulator.rs +++ b/components/salsa-macros/src/accumulator.rs @@ -19,7 +19,7 @@ pub(crate) fn accumulator( let ident = struct_item.ident.clone(); let m = StructMacro { hygiene, - args, + _args: args, struct_item, }; match m.try_expand() { @@ -34,8 +34,8 @@ impl AllowedOptions for Accumulator { const RETURN_REF: bool = false; const SPECIFY: bool = false; const NO_EQ: bool = false; - const NO_DEBUG: bool = true; - const NO_CLONE: bool = true; + const DEBUG: bool = false; + const NO_CLONE: bool = false; const NO_LIFETIME: bool = false; const SINGLETON: bool = false; const DATA: bool = false; @@ -49,7 +49,7 @@ impl AllowedOptions for Accumulator { struct StructMacro { hygiene: Hygiene, - args: Options, + _args: Options, struct_item: syn::ItemStruct, } @@ -65,16 +65,7 @@ impl StructMacro { let struct_item = self.struct_item; - let mut derives = vec![]; - if self.args.no_debug.is_none() { - derives.push(quote!(Debug)); - } - if self.args.no_clone.is_none() { - derives.push(quote!(Clone)); - } - Ok(quote! { - #[derive(#(#derives),*)] #struct_item salsa::plumbing::setup_accumulator_impl! { diff --git a/components/salsa-macros/src/input.rs b/components/salsa-macros/src/input.rs index cc330a584..f455309f3 100644 --- a/components/salsa-macros/src/input.rs +++ b/components/salsa-macros/src/input.rs @@ -40,7 +40,7 @@ impl crate::options::AllowedOptions for InputStruct { const NO_EQ: bool = false; - const NO_DEBUG: bool = true; + const DEBUG: bool = true; const NO_LIFETIME: bool = false; diff --git a/components/salsa-macros/src/interned.rs b/components/salsa-macros/src/interned.rs index dea7116ce..7e877128a 100644 --- a/components/salsa-macros/src/interned.rs +++ b/components/salsa-macros/src/interned.rs @@ -41,7 +41,7 @@ impl crate::options::AllowedOptions for InternedStruct { const NO_EQ: bool = false; - const NO_DEBUG: bool = true; + const DEBUG: bool = true; const NO_LIFETIME: bool = true; diff --git a/components/salsa-macros/src/options.rs b/components/salsa-macros/src/options.rs index cbb4ecaf6..12e93af3f 100644 --- a/components/salsa-macros/src/options.rs +++ b/components/salsa-macros/src/options.rs @@ -20,10 +20,10 @@ pub(crate) struct Options { /// If this is `Some`, the value is the `no_eq` identifier. pub no_eq: Option, - /// Signal we should not generate a `Debug` impl. + /// Signal we should generate a `Debug` impl. /// - /// If this is `Some`, the value is the `no_debug` identifier. - pub no_debug: Option, + /// If this is `Some`, the value is the `debug` identifier. + pub debug: Option, /// Signal we should not include the `'db` lifetime. /// @@ -93,7 +93,7 @@ impl Default for Options { return_ref: Default::default(), specify: Default::default(), no_eq: Default::default(), - no_debug: Default::default(), + debug: Default::default(), no_lifetime: Default::default(), no_clone: Default::default(), db_path: Default::default(), @@ -114,7 +114,7 @@ pub(crate) trait AllowedOptions { const RETURN_REF: bool; const SPECIFY: bool; const NO_EQ: bool; - const NO_DEBUG: bool; + const DEBUG: bool; const NO_LIFETIME: bool; const NO_CLONE: bool; const SINGLETON: bool; @@ -161,18 +161,15 @@ impl syn::parse::Parse for Options { "`no_eq` option not allowed here", )); } - } else if ident == "no_debug" { - if A::NO_DEBUG { - if let Some(old) = options.no_debug.replace(ident) { - return Err(syn::Error::new( - old.span(), - "option `no_debug` provided twice", - )); + } else if ident == "debug" { + if A::DEBUG { + if let Some(old) = options.debug.replace(ident) { + return Err(syn::Error::new(old.span(), "option `debug` provided twice")); } } else { return Err(syn::Error::new( ident.span(), - "`no_debug` option not allowed here", + "`debug` option not allowed here", )); } } else if ident == "no_lifetime" { diff --git a/components/salsa-macros/src/salsa_struct.rs b/components/salsa-macros/src/salsa_struct.rs index e6147522b..409baa147 100644 --- a/components/salsa-macros/src/salsa_struct.rs +++ b/components/salsa-macros/src/salsa_struct.rs @@ -330,7 +330,7 @@ where } pub fn generate_debug_impl(&self) -> bool { - self.args.no_debug.is_none() + self.args.debug.is_some() } pub fn generate_lifetime(&self) -> bool { diff --git a/components/salsa-macros/src/tracked_fn.rs b/components/salsa-macros/src/tracked_fn.rs index 178ed162e..7664b6548 100644 --- a/components/salsa-macros/src/tracked_fn.rs +++ b/components/salsa-macros/src/tracked_fn.rs @@ -29,7 +29,7 @@ impl crate::options::AllowedOptions for TrackedFn { const NO_EQ: bool = true; - const NO_DEBUG: bool = false; + const DEBUG: bool = false; const NO_LIFETIME: bool = false; diff --git a/components/salsa-macros/src/tracked_struct.rs b/components/salsa-macros/src/tracked_struct.rs index be8ccdf5f..623c9ba2b 100644 --- a/components/salsa-macros/src/tracked_struct.rs +++ b/components/salsa-macros/src/tracked_struct.rs @@ -35,7 +35,7 @@ impl crate::options::AllowedOptions for TrackedStruct { const NO_EQ: bool = false; - const NO_DEBUG: bool = true; + const DEBUG: bool = true; const NO_LIFETIME: bool = false; diff --git a/examples/calc/ir.rs b/examples/calc/ir.rs index db4ffe701..45b8ed54f 100644 --- a/examples/calc/ir.rs +++ b/examples/calc/ir.rs @@ -3,7 +3,7 @@ use ordered_float::OrderedFloat; // ANCHOR: input -#[salsa::input] +#[salsa::input(debug)] pub struct SourceProgram { #[return_ref] pub text: String, @@ -11,13 +11,13 @@ pub struct SourceProgram { // ANCHOR_END: input // ANCHOR: interned_ids -#[salsa::interned] +#[salsa::interned(debug)] pub struct VariableId<'db> { #[return_ref] pub text: String, } -#[salsa::interned] +#[salsa::interned(debug)] pub struct FunctionId<'db> { #[return_ref] pub text: String, @@ -25,7 +25,7 @@ pub struct FunctionId<'db> { // ANCHOR_END: interned_ids // ANCHOR: program -#[salsa::tracked] +#[salsa::tracked(debug)] pub struct Program<'db> { #[tracked] #[return_ref] @@ -86,7 +86,7 @@ pub enum Op { // ANCHOR_END: statements_and_expressions // ANCHOR: functions -#[salsa::tracked] +#[salsa::tracked(debug)] pub struct Function<'db> { pub name: FunctionId<'db>, @@ -102,7 +102,7 @@ pub struct Function<'db> { } // ANCHOR_END: functions -#[salsa::tracked] +#[salsa::tracked(debug)] pub struct Span<'db> { #[tracked] pub start: usize, @@ -112,6 +112,7 @@ pub struct Span<'db> { // ANCHOR: diagnostic #[salsa::accumulator] +#[derive(Debug)] #[allow(dead_code)] // Debug impl uses them pub struct Diagnostic { pub start: usize, diff --git a/src/accumulator.rs b/src/accumulator.rs index a470c26a6..dfa36fcf8 100644 --- a/src/accumulator.rs +++ b/src/accumulator.rs @@ -2,7 +2,7 @@ use std::{ any::{Any, TypeId}, - fmt::{self, Debug}, + fmt, marker::PhantomData, panic::UnwindSafe, }; @@ -25,7 +25,7 @@ pub(crate) mod accumulated_map; /// Trait implemented on the struct that user annotated with `#[salsa::accumulator]`. /// The `Self` type is therefore the types to be accumulated. -pub trait Accumulator: Debug + Send + Sync + Any + Sized + UnwindSafe { +pub trait Accumulator: Send + Sync + Any + Sized + UnwindSafe { const DEBUG_NAME: &'static str; /// Accumulate an instance of this in the database for later retrieval. diff --git a/src/accumulator/accumulated.rs b/src/accumulator/accumulated.rs index b3774ce90..8903b59d7 100644 --- a/src/accumulator/accumulated.rs +++ b/src/accumulator/accumulated.rs @@ -8,7 +8,7 @@ pub(crate) struct Accumulated { values: Vec, } -pub(crate) trait AnyAccumulated: Any + Debug + Send + Sync { +pub(crate) trait AnyAccumulated: Any + Send + Sync { fn as_dyn_any(&self) -> &dyn Any; fn as_dyn_any_mut(&mut self) -> &mut dyn Any; } diff --git a/src/accumulator/accumulated_map.rs b/src/accumulator/accumulated_map.rs index eecccc42a..16bc28576 100644 --- a/src/accumulator/accumulated_map.rs +++ b/src/accumulator/accumulated_map.rs @@ -9,11 +9,19 @@ use crate::IngredientIndex; use super::{accumulated::Accumulated, Accumulator, AnyAccumulated}; -#[derive(Default, Debug)] +#[derive(Default)] pub struct AccumulatedMap { map: FxHashMap>, } +impl std::fmt::Debug for AccumulatedMap { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("AccumulatedMap") + .field("map", &self.map.keys()) + .finish() + } +} + impl AccumulatedMap { pub fn accumulate(&mut self, index: IngredientIndex, value: A) { self.map diff --git a/src/function.rs b/src/function.rs index 216f0fac9..08138fdf6 100644 --- a/src/function.rs +++ b/src/function.rs @@ -48,7 +48,7 @@ pub trait Configuration: Any { type Input<'db>: Send + Sync; /// The value computed by the function. - type Output<'db>: fmt::Debug + Send + Sync; + type Output<'db>: Send + Sync; /// Determines whether this function can recover from being a participant in a cycle /// (and, if so, how). diff --git a/src/function/memo.rs b/src/function/memo.rs index 390e4d587..ae5b6f91b 100644 --- a/src/function/memo.rs +++ b/src/function/memo.rs @@ -276,7 +276,7 @@ impl Memo { } } -impl crate::table::memo::Memo for Memo { +impl crate::table::memo::Memo for Memo { fn origin(&self) -> &QueryOrigin { &self.revisions.origin } diff --git a/src/id.rs b/src/id.rs index c1c57b1be..63fe32020 100644 --- a/src/id.rs +++ b/src/id.rs @@ -59,7 +59,7 @@ pub trait AsId: Sized { } /// Internal Salsa trait for types that are just a newtype'd [`Id`][]. -pub trait FromId: AsId + Copy + Eq + Hash + Debug { +pub trait FromId: AsId + Copy + Eq + Hash { fn from_id(id: Id) -> Self; } @@ -77,7 +77,7 @@ impl FromId for Id { /// Enums cannot use [`FromId`] because they need access to the DB to tell the `TypeId` of the variant, /// so they use this trait instead, that has a blanket implementation for `FromId`. -pub trait FromIdWithDb: AsId + Copy + Eq + Hash + Debug { +pub trait FromIdWithDb: AsId + Copy + Eq + Hash { fn from_id(id: Id, db: &(impl ?Sized + Database)) -> Self; } diff --git a/src/table/memo.rs b/src/table/memo.rs index 1d74f8a98..23bca7e2a 100644 --- a/src/table/memo.rs +++ b/src/table/memo.rs @@ -1,6 +1,5 @@ use std::{ any::{Any, TypeId}, - fmt::Debug, ptr::NonNull, sync::atomic::{AtomicPtr, Ordering}, }; @@ -17,7 +16,7 @@ pub(crate) struct MemoTable { memos: RwLock>, } -pub(crate) trait Memo: Any + Send + Sync + Debug { +pub(crate) trait Memo: Any + Send + Sync { /// Returns the `origin` of this memo fn origin(&self) -> &QueryOrigin; } diff --git a/tests/accumulate-chain.rs b/tests/accumulate-chain.rs index b0d79bd48..231fbe079 100644 --- a/tests/accumulate-chain.rs +++ b/tests/accumulate-chain.rs @@ -8,6 +8,7 @@ use salsa::{Accumulator, Database, DatabaseImpl}; use test_log::test; #[salsa::accumulator] +#[derive(Debug)] struct Log(#[allow(dead_code)] String); #[salsa::tracked] diff --git a/tests/accumulate-custom-debug.rs b/tests/accumulate-custom-debug.rs index 71a4ba86e..a4c078ab7 100644 --- a/tests/accumulate-custom-debug.rs +++ b/tests/accumulate-custom-debug.rs @@ -4,12 +4,12 @@ use expect_test::expect; use salsa::{Accumulator, Database}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { count: u32, } -#[salsa::accumulator(no_debug)] +#[salsa::accumulator] struct Log(String); impl std::fmt::Debug for Log { diff --git a/tests/accumulate-dag.rs b/tests/accumulate-dag.rs index e23050ba4..cb4d67cf0 100644 --- a/tests/accumulate-dag.rs +++ b/tests/accumulate-dag.rs @@ -4,13 +4,14 @@ use expect_test::expect; use salsa::{Accumulator, Database}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field_a: u32, field_b: u32, } #[salsa::accumulator] +#[derive(Debug)] struct Log(#[allow(dead_code)] String); #[salsa::tracked] diff --git a/tests/accumulate-execution-order.rs b/tests/accumulate-execution-order.rs index edb82e487..6a4b69394 100644 --- a/tests/accumulate-execution-order.rs +++ b/tests/accumulate-execution-order.rs @@ -8,6 +8,7 @@ use salsa::{Accumulator, Database}; use test_log::test; #[salsa::accumulator] +#[derive(Debug)] struct Log(#[allow(dead_code)] String); #[salsa::tracked] diff --git a/tests/accumulate-from-tracked-fn.rs b/tests/accumulate-from-tracked-fn.rs index 33d7bd3f5..a0961f06b 100644 --- a/tests/accumulate-from-tracked-fn.rs +++ b/tests/accumulate-from-tracked-fn.rs @@ -6,14 +6,14 @@ use expect_test::expect; use salsa::{Accumulator, Setter}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct List { value: u32, next: Option, } #[salsa::accumulator] -#[derive(Copy)] +#[derive(Copy, Clone, Debug)] struct Integers(u32); #[salsa::tracked] diff --git a/tests/accumulate-no-duplicates.rs b/tests/accumulate-no-duplicates.rs index faf8c03af..040a7ed5a 100644 --- a/tests/accumulate-no-duplicates.rs +++ b/tests/accumulate-no-duplicates.rs @@ -22,9 +22,10 @@ use test_log::test; // } #[salsa::accumulator] +#[derive(Debug)] struct Log(#[allow(dead_code)] String); -#[salsa::input] +#[salsa::input(debug)] struct MyInput { n: u32, } diff --git a/tests/accumulate-reuse-workaround.rs b/tests/accumulate-reuse-workaround.rs index d72f971b0..cfc51a05d 100644 --- a/tests/accumulate-reuse-workaround.rs +++ b/tests/accumulate-reuse-workaround.rs @@ -9,14 +9,14 @@ use expect_test::expect; use salsa::{Accumulator, Setter}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct List { value: u32, next: Option, } #[salsa::accumulator] -#[derive(Copy)] +#[derive(Copy, Clone, Debug)] struct Integers(u32); #[salsa::tracked] diff --git a/tests/accumulate-reuse.rs b/tests/accumulate-reuse.rs index b9962849a..4a1ce2198 100644 --- a/tests/accumulate-reuse.rs +++ b/tests/accumulate-reuse.rs @@ -10,7 +10,7 @@ use expect_test::expect; use salsa::{Accumulator, Setter}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct List { value: u32, next: Option, diff --git a/tests/accumulate.rs b/tests/accumulate.rs index a69c27a1d..95d0ca8d6 100644 --- a/tests/accumulate.rs +++ b/tests/accumulate.rs @@ -5,13 +5,14 @@ use expect_test::expect; use salsa::{Accumulator, Setter}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field_a: u32, field_b: u32, } #[salsa::accumulator] +#[derive(Debug)] struct Log(#[allow(dead_code)] String); #[salsa::tracked] diff --git a/tests/accumulated_backdate.rs b/tests/accumulated_backdate.rs index b9d895487..68f861a83 100644 --- a/tests/accumulated_backdate.rs +++ b/tests/accumulated_backdate.rs @@ -8,12 +8,13 @@ use expect_test::expect; use salsa::{Accumulator, Setter}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct File { content: String, } #[salsa::accumulator] +#[derive(Debug)] struct Log(#[allow(dead_code)] String); #[salsa::tracked] diff --git a/tests/cycle.rs b/tests/cycle.rs index 7f17034f6..23b81a633 100644 --- a/tests/cycle.rs +++ b/tests/cycle.rs @@ -43,7 +43,7 @@ impl Inputs { } /// A single input, evaluating to a single [`Value`]. -#[derive(Clone, Debug)] +#[derive(Clone)] enum Input { /// a simple value Value(Value), diff --git a/tests/cycle_accumulate.rs b/tests/cycle_accumulate.rs index 484a6a6fc..6cab2eddd 100644 --- a/tests/cycle_accumulate.rs +++ b/tests/cycle_accumulate.rs @@ -7,7 +7,7 @@ use expect_test::expect; use salsa::{Accumulator, Setter}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct File { name: String, dependencies: Vec, @@ -15,6 +15,7 @@ struct File { } #[salsa::accumulator] +#[derive(Debug)] struct Diagnostic(#[allow(dead_code)] String); #[salsa::tracked(cycle_fn = cycle_fn, cycle_initial = cycle_initial)] diff --git a/tests/debug.rs b/tests/debug.rs index 3c2c896c1..03b59dcab 100644 --- a/tests/debug.rs +++ b/tests/debug.rs @@ -3,7 +3,7 @@ use expect_test::expect; use salsa::{Database, Setter}; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } @@ -13,7 +13,7 @@ struct NotSalsa { field: String, } -#[salsa::input] +#[salsa::input(debug)] struct ComplexStruct { my_input: MyInput, not_salsa: NotSalsa, @@ -63,7 +63,7 @@ fn untracked_dependencies() { assert!(s.contains(", field: 22 }")); } -#[salsa::tracked(no_debug)] +#[salsa::tracked] struct DerivedCustom<'db> { my_input: MyInput, value: u32, diff --git a/tests/debug_db_contents.rs b/tests/debug_db_contents.rs index dca656c3f..30efb1736 100644 --- a/tests/debug_db_contents.rs +++ b/tests/debug_db_contents.rs @@ -1,14 +1,14 @@ -#[salsa::interned] +#[salsa::interned(debug)] struct InternedStruct<'db> { name: String, } -#[salsa::input] +#[salsa::input(debug)] struct InputStruct { field: u32, } -#[salsa::tracked] +#[salsa::tracked(debug)] struct TrackedStruct<'db> { field: u32, } diff --git a/tests/deletion-cascade.rs b/tests/deletion-cascade.rs index 7b3b2211e..f5be5213a 100644 --- a/tests/deletion-cascade.rs +++ b/tests/deletion-cascade.rs @@ -9,7 +9,7 @@ use expect_test::expect; use salsa::Setter; use test_log::test; -#[salsa::input(singleton)] +#[salsa::input(singleton, debug)] struct MyInput { field: u32, } diff --git a/tests/deletion.rs b/tests/deletion.rs index 0aef146c1..5066950f0 100644 --- a/tests/deletion.rs +++ b/tests/deletion.rs @@ -9,7 +9,7 @@ use expect_test::expect; use salsa::Setter; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } diff --git a/tests/elided-lifetime-in-tracked-fn.rs b/tests/elided-lifetime-in-tracked-fn.rs index f62c23a87..1aef63158 100644 --- a/tests/elided-lifetime-in-tracked-fn.rs +++ b/tests/elided-lifetime-in-tracked-fn.rs @@ -8,7 +8,7 @@ use expect_test::expect; use salsa::Setter; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } diff --git a/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs b/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs index cf3d62c61..9547c9bb6 100644 --- a/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs +++ b/tests/expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs @@ -9,7 +9,7 @@ use common::LogDatabase; use expect_test::expect; use salsa::Setter; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } diff --git a/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs b/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs index b5411e44c..4410949f7 100644 --- a/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs +++ b/tests/expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs @@ -9,7 +9,7 @@ use common::LogDatabase; use expect_test::expect; use salsa::Setter; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { x: u32, y: u32, diff --git a/tests/hello_world.rs b/tests/hello_world.rs index 04cfdee99..605113a1b 100644 --- a/tests/hello_world.rs +++ b/tests/hello_world.rs @@ -8,7 +8,7 @@ use expect_test::expect; use salsa::Setter; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } diff --git a/tests/interned-structs.rs b/tests/interned-structs.rs index 4b1e10709..6d5d9e6d9 100644 --- a/tests/interned-structs.rs +++ b/tests/interned-structs.rs @@ -6,38 +6,38 @@ use salsa::plumbing::{AsId, FromId}; use std::path::{Path, PathBuf}; use test_log::test; -#[salsa::interned] +#[salsa::interned(debug)] struct InternedBoxed<'db> { data: Box, } -#[salsa::interned] +#[salsa::interned(debug)] struct InternedString<'db> { data: String, } -#[salsa::interned] +#[salsa::interned(debug)] struct InternedPair<'db> { data: (InternedString<'db>, InternedString<'db>), } -#[salsa::interned] +#[salsa::interned(debug)] struct InternedTwoFields<'db> { data1: String, data2: String, } -#[salsa::interned] +#[salsa::interned(debug)] struct InternedVec<'db> { data1: Vec, } -#[salsa::interned] +#[salsa::interned(debug)] struct InternedPathBuf<'db> { data1: PathBuf, } -#[salsa::interned(no_lifetime)] +#[salsa::interned(no_lifetime, debug)] struct InternedStringNoLifetime { data: String, } @@ -45,7 +45,7 @@ struct InternedStringNoLifetime { #[derive(Debug, Eq, PartialEq, Hash, Clone)] struct Foo; -#[salsa::interned] +#[salsa::interned(debug)] struct InternedFoo<'db> { data: Foo, } @@ -65,12 +65,12 @@ impl FromId for SalsaIdWrapper { } } -#[salsa::interned(id = SalsaIdWrapper)] +#[salsa::interned(id = SalsaIdWrapper, debug)] struct InternedStringWithCustomId<'db> { data: String, } -#[salsa::interned(id = SalsaIdWrapper, no_lifetime)] +#[salsa::interned(id = SalsaIdWrapper, no_lifetime, debug)] struct InternedStringWithCustomIdAndNoLifetime<'db> { data: String, } diff --git a/tests/parallel/parallel_cancellation.rs b/tests/parallel/parallel_cancellation.rs index 2b5a05fbb..1d4f70d9c 100644 --- a/tests/parallel/parallel_cancellation.rs +++ b/tests/parallel/parallel_cancellation.rs @@ -6,7 +6,7 @@ use salsa::Setter; use crate::setup::Knobs; use crate::setup::KnobsDatabase; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: i32, } diff --git a/tests/singleton.rs b/tests/singleton.rs index 539d48cb8..d0a7cf4f9 100644 --- a/tests/singleton.rs +++ b/tests/singleton.rs @@ -7,7 +7,7 @@ use expect_test::expect; use salsa::Database as _; use test_log::test; -#[salsa::input(singleton)] +#[salsa::input(singleton, debug)] struct MyInput { field: u32, id_field: u16, diff --git a/tests/tracked_fn_on_interned_enum.rs b/tests/tracked_fn_on_interned_enum.rs index 0a4b0a37e..63fa03b67 100644 --- a/tests/tracked_fn_on_interned_enum.rs +++ b/tests/tracked_fn_on_interned_enum.rs @@ -1,17 +1,17 @@ //! Test that a `tracked` fn on a `salsa::interned` //! compiles and executes successfully. -#[salsa::interned(no_lifetime)] +#[salsa::interned(no_lifetime, debug)] struct Name { name: String, } -#[salsa::interned] +#[salsa::interned(debug)] struct NameAndAge<'db> { name_and_age: String, } -#[salsa::interned(no_lifetime)] +#[salsa::interned(no_lifetime, debug)] struct Age { age: u32, } @@ -23,7 +23,7 @@ enum Enum<'db> { Age(Age), } -#[salsa::input] +#[salsa::input(debug)] struct Input { value: String, } diff --git a/tests/tracked_fn_read_own_entity.rs b/tests/tracked_fn_read_own_entity.rs index 48ed793d1..8d5f333b3 100644 --- a/tests/tracked_fn_read_own_entity.rs +++ b/tests/tracked_fn_read_own_entity.rs @@ -7,7 +7,7 @@ use common::LogDatabase; use salsa::Setter; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } diff --git a/tests/tracked_fn_read_own_specify.rs b/tests/tracked_fn_read_own_specify.rs index c91bac602..a96cba356 100644 --- a/tests/tracked_fn_read_own_specify.rs +++ b/tests/tracked_fn_read_own_specify.rs @@ -3,12 +3,12 @@ mod common; use common::LogDatabase; use salsa::Database; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: u32, } -#[salsa::tracked] +#[salsa::tracked(debug)] struct MyTracked<'db> { field: u32, } diff --git a/tests/tracked_struct_recreate_new_revision.rs b/tests/tracked_struct_recreate_new_revision.rs index 147ad6070..c1786a2dd 100644 --- a/tests/tracked_struct_recreate_new_revision.rs +++ b/tests/tracked_struct_recreate_new_revision.rs @@ -9,7 +9,7 @@ struct MyInput { field: u32, } -#[salsa::tracked] +#[salsa::tracked(debug)] struct TrackedStruct<'db> { field: u32, } diff --git a/tests/tracked_with_struct_db.rs b/tests/tracked_with_struct_db.rs index 670673a17..92f05acd7 100644 --- a/tests/tracked_with_struct_db.rs +++ b/tests/tracked_with_struct_db.rs @@ -4,12 +4,12 @@ use salsa::{Database, DatabaseImpl}; use test_log::test; -#[salsa::input] +#[salsa::input(debug)] struct MyInput { field: String, } -#[salsa::tracked] +#[salsa::tracked(debug)] struct MyTracked<'db> { #[tracked] data: MyInput,