mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-22 21:05:11 +00:00
remove "constant" functions
The goal here is that ALL `Id` values come from a `Table`
This commit is contained in:
parent
31257ba758
commit
8833a7168b
2 changed files with 2 additions and 16 deletions
|
@ -104,8 +104,8 @@ impl Macro {
|
|||
}
|
||||
|
||||
let needs_interner = match function_type {
|
||||
FunctionType::RequiresInterning => true,
|
||||
FunctionType::Constant | FunctionType::SalsaStruct => false,
|
||||
FunctionType::Constant | FunctionType::RequiresInterning => true,
|
||||
FunctionType::SalsaStruct => false,
|
||||
};
|
||||
|
||||
let lru = Literal::usize_unsuffixed(self.args.lru.unwrap_or(0));
|
||||
|
|
14
src/id.rs
14
src/id.rs
|
@ -118,20 +118,6 @@ impl FromId for Id {
|
|||
}
|
||||
}
|
||||
|
||||
/// As a special case, we permit `Singleton` to be converted to an `Id`.
|
||||
/// This is useful for declaring functions with no arguments.
|
||||
impl AsId for () {
|
||||
fn as_id(&self) -> Id {
|
||||
Id::from_u32(0)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromId for () {
|
||||
fn from_id(id: Id) -> Self {
|
||||
assert_eq!(0, id.as_u32());
|
||||
}
|
||||
}
|
||||
|
||||
impl<'db, ID: FromId> LookupId<'db> for ID {
|
||||
fn lookup_id(id: Id, _db: &'db dyn Database) -> Self {
|
||||
Self::from_id(id)
|
||||
|
|
Loading…
Reference in a new issue