Skip to content

Commit 9364f15

Browse files
committed
Use a custom test in case &'static str later implements Update
1 parent 38e20bb commit 9364f15

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/tracked_fn_return_static.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@ use salsa::Database;
66
#[salsa::input]
77
struct Input {}
88

9+
#[derive(Clone, PartialEq)]
10+
struct NotUpdate<'a> {
11+
_marker: std::marker::PhantomData<&'a ()>,
12+
}
13+
914
#[salsa::tracked]
10-
fn test(_db: &dyn salsa::Database, _: Input) -> &'static str {
11-
"test"
15+
fn test(_db: &dyn salsa::Database, _: Input) -> NotUpdate<'static> {
16+
NotUpdate {
17+
_marker: std::marker::PhantomData,
18+
}
1219
}
1320

1421
#[test]
1522
fn invoke() {
1623
salsa::DatabaseImpl::new().attach(|db| {
1724
let input = Input::new(db);
18-
let x: &str = test(db, input);
19-
assert_eq!(x, "test");
25+
test(db, input);
2026
})
2127
}

0 commit comments

Comments
 (0)