mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-28 17:42:00 +00:00
cargo fmt
This commit is contained in:
parent
0e01067d55
commit
897ee5f3d2
6 changed files with 11 additions and 18 deletions
|
@ -360,9 +360,7 @@ pub(crate) fn query_group(args: TokenStream, input: TokenStream) -> TokenStream
|
||||||
QueryStorage::Dependencies => quote!(salsa::plumbing::DependencyStorage<#db, Self>),
|
QueryStorage::Dependencies => quote!(salsa::plumbing::DependencyStorage<#db, Self>),
|
||||||
QueryStorage::Input => quote!(salsa::plumbing::InputStorage<#db, Self>),
|
QueryStorage::Input => quote!(salsa::plumbing::InputStorage<#db, Self>),
|
||||||
QueryStorage::Interned => quote!(salsa::plumbing::InternedStorage<#db, Self>),
|
QueryStorage::Interned => quote!(salsa::plumbing::InternedStorage<#db, Self>),
|
||||||
QueryStorage::InternedLookup { intern_query_type } => {
|
QueryStorage::InternedLookup { intern_query_type } => quote!(salsa::plumbing::LookupInternedStorage<#db, Self, #intern_query_type>),
|
||||||
quote!(salsa::plumbing::LookupInternedStorage<#db, Self, #intern_query_type>)
|
|
||||||
}
|
|
||||||
QueryStorage::Transparent => continue,
|
QueryStorage::Transparent => continue,
|
||||||
};
|
};
|
||||||
let keys = &query.keys;
|
let keys = &query.keys;
|
||||||
|
|
|
@ -75,9 +75,9 @@ where
|
||||||
DB: Database,
|
DB: Database,
|
||||||
{
|
{
|
||||||
fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result<Q::Value, CycleError<DB::DatabaseKey>> {
|
fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result<Q::Value, CycleError<DB::DatabaseKey>> {
|
||||||
let slot = self.slot(key).unwrap_or_else(|| {
|
let slot = self
|
||||||
panic!("no value set for {:?}({:?})", Q::default(), key)
|
.slot(key)
|
||||||
});
|
.unwrap_or_else(|| panic!("no value set for {:?}({:?})", Q::default(), key));
|
||||||
|
|
||||||
let StampedValue {
|
let StampedValue {
|
||||||
value,
|
value,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use crate::debug::TableEntry;
|
use crate::debug::TableEntry;
|
||||||
use crate::CycleError;
|
|
||||||
use crate::durability::Durability;
|
use crate::durability::Durability;
|
||||||
|
use crate::CycleError;
|
||||||
use crate::Database;
|
use crate::Database;
|
||||||
use crate::Query;
|
use crate::Query;
|
||||||
use crate::QueryTable;
|
use crate::QueryTable;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
use crate::setup::{
|
use crate::setup::{CancelationFlag, Canceled, Knobs, ParDatabase, ParDatabaseImpl, WithValue};
|
||||||
CancelationFlag, Canceled, Knobs, ParDatabase, ParDatabaseImpl, WithValue,
|
|
||||||
};
|
|
||||||
use salsa::ParallelDatabase;
|
use salsa::ParallelDatabase;
|
||||||
|
|
||||||
macro_rules! assert_canceled {
|
macro_rules! assert_canceled {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
//! Test `salsa::requires` attribute for private query dependencies
|
//! Test `salsa::requires` attribute for private query dependencies
|
||||||
//! https://github.com/salsa-rs/salsa-rfcs/pull/3
|
//! https://github.com/salsa-rs/salsa-rfcs/pull/3
|
||||||
|
|
||||||
|
|
||||||
mod queries {
|
mod queries {
|
||||||
#[salsa::query_group(InputGroupStorage)]
|
#[salsa::query_group(InputGroupStorage)]
|
||||||
pub trait InputGroup {
|
pub trait InputGroup {
|
||||||
|
@ -14,7 +13,7 @@ mod queries {
|
||||||
fn private_a(&self, x: u32) -> u32;
|
fn private_a(&self, x: u32) -> u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn private_a(db: &impl PrivGroupA, x: u32) -> u32{
|
fn private_a(db: &impl PrivGroupA, x: u32) -> u32 {
|
||||||
db.input(x)
|
db.input(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +22,7 @@ mod queries {
|
||||||
fn private_b(&self, x: u32) -> u32;
|
fn private_b(&self, x: u32) -> u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn private_b(db: &impl PrivGroupB, x: u32) -> u32{
|
fn private_b(db: &impl PrivGroupB, x: u32) -> u32 {
|
||||||
db.input(x)
|
db.input(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +33,6 @@ mod queries {
|
||||||
fn public(&self, x: u32) -> u32;
|
fn public(&self, x: u32) -> u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn public(db: &(impl PubGroup + PrivGroupA + PrivGroupB), x: u32) -> u32 {
|
fn public(db: &(impl PubGroup + PrivGroupA + PrivGroupB), x: u32) -> u32 {
|
||||||
db.private_a(x) + db.private_b(x)
|
db.private_a(x) + db.private_b(x)
|
||||||
}
|
}
|
||||||
|
@ -44,7 +42,7 @@ mod queries {
|
||||||
queries::InputGroupStorage,
|
queries::InputGroupStorage,
|
||||||
queries::PrivGroupAStorage,
|
queries::PrivGroupAStorage,
|
||||||
queries::PrivGroupBStorage,
|
queries::PrivGroupBStorage,
|
||||||
queries::PubGroupStorage,
|
queries::PubGroupStorage
|
||||||
)]
|
)]
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct Database {
|
struct Database {
|
||||||
|
|
|
@ -17,7 +17,6 @@ fn get(db: &impl QueryGroup, x: u32) -> u32 {
|
||||||
db.wrap(x)
|
db.wrap(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[salsa::database(QueryGroupStorage)]
|
#[salsa::database(QueryGroupStorage)]
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct Database {
|
struct Database {
|
||||||
|
|
Loading…
Reference in a new issue