Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/salsa-macros/src/interned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl AllowedOptions for InternedStruct {

const NO_LIFETIME: bool = true;

const NON_UPDATE_TYPES: bool = false;
const NON_UPDATE_TYPES: bool = true;

const SINGLETON: bool = true;

Expand Down
9 changes: 3 additions & 6 deletions components/salsa-macros/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,15 @@ impl<A: AllowedOptions> syn::parse::Parse for Options<A> {
let content;
parenthesized!(content in input);
let ident = syn::Ident::parse_any(&content)?;
if ident == "non_update_return_type" {
if ident == "non_update_types" {
if let Some(old) = options.non_update_types.replace(ident) {
return Err(syn::Error::new(
old.span(),
"option `non_update_return_type` provided twice",
"option `non_update_types` provided twice",
));
}
} else {
return Err(syn::Error::new(
ident.span(),
"expected `non_update_return_type`",
));
return Err(syn::Error::new(ident.span(), "expected `non_update_types`"));
}
} else {
return Err(syn::Error::new(
Expand Down
2 changes: 1 addition & 1 deletion tests/tracked_fn_orphan_escape_hatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct MyInput {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct NotUpdate<'a>(PhantomData<fn() -> &'a ()>);

#[salsa::tracked(unsafe(non_update_return_type))]
#[salsa::tracked(unsafe(non_update_types))]
fn tracked_fn(db: &dyn salsa::Database, input: MyInput) -> NotUpdate<'_> {
NotUpdate(PhantomData)
}
Expand Down
Loading