We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2fbc8e commit 38e20bbCopy full SHA for 38e20bb
tests/tracked_fn_return_static.rs
@@ -0,0 +1,21 @@
1
+//! Test that a `tracked` function can return a
2
+//! non-`Update` type, so long as it has `'static` lifetime.
3
+
4
+use salsa::Database;
5
6
+#[salsa::input]
7
+struct Input {}
8
9
+#[salsa::tracked]
10
+fn test(_db: &dyn salsa::Database, _: Input) -> &'static str {
11
+ "test"
12
+}
13
14
+#[test]
15
+fn invoke() {
16
+ salsa::DatabaseImpl::new().attach(|db| {
17
+ let input = Input::new(db);
18
+ let x: &str = test(db, input);
19
+ assert_eq!(x, "test");
20
+ })
21
0 commit comments