name the field runtime_id

This commit is contained in:
Niko Matsakis 2018-10-30 20:39:56 -04:00
parent cf9db9cc7f
commit 2e3f8b1a3d
4 changed files with 11 additions and 11 deletions

View file

@ -315,7 +315,7 @@ where
); );
db.salsa_event(|| Event { db.salsa_event(|| Event {
id: runtime.id(), runtime_id: runtime.id(),
kind: EventKind::DidValidateMemoizedValue { kind: EventKind::DidValidateMemoizedValue {
descriptor: descriptor.clone(), descriptor: descriptor.clone(),
}, },
@ -464,9 +464,9 @@ where
std::mem::drop(map); std::mem::drop(map);
db.salsa_event(|| Event { db.salsa_event(|| Event {
id: db.salsa_runtime().id(), runtime_id: db.salsa_runtime().id(),
kind: EventKind::WillBlockOn { kind: EventKind::WillBlockOn {
other_id, other_runtime_id: other_id,
descriptor: descriptor.clone(), descriptor: descriptor.clone(),
}, },
}); });

View file

@ -84,7 +84,7 @@ where
let mut map = self.map.write(); let mut map = self.map.write();
db.salsa_event(|| Event { db.salsa_event(|| Event {
id: db.salsa_runtime().id(), runtime_id: db.salsa_runtime().id(),
kind: EventKind::WillChangeInputValue { kind: EventKind::WillChangeInputValue {
descriptor: descriptor.clone(), descriptor: descriptor.clone(),
}, },

View file

@ -73,14 +73,14 @@ pub trait Database: plumbing::DatabaseStorageTypes + plumbing::DatabaseOps {
} }
pub struct Event<DB: Database> { pub struct Event<DB: Database> {
pub id: RuntimeId, pub runtime_id: RuntimeId,
pub kind: EventKind<DB>, pub kind: EventKind<DB>,
} }
impl<DB: Database> fmt::Debug for Event<DB> { impl<DB: Database> fmt::Debug for Event<DB> {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("Event") fmt.debug_struct("Event")
.field("id", &self.id) .field("runtime_id", &self.runtime_id)
.field("kind", &self.kind) .field("kind", &self.kind)
.finish() .finish()
} }
@ -94,7 +94,7 @@ pub enum EventKind<DB: Database> {
/// Executes before the "re-used" value is returned. /// Executes before the "re-used" value is returned.
DidValidateMemoizedValue { descriptor: DB::QueryDescriptor }, DidValidateMemoizedValue { descriptor: DB::QueryDescriptor },
/// Indicates that another thread (with id `other_id`) is processing the /// Indicates that another thread (with id `other_runtime_id`) is processing the
/// given query (`descriptor`), so we will block until they /// given query (`descriptor`), so we will block until they
/// finish. /// finish.
/// ///
@ -104,7 +104,7 @@ pub enum EventKind<DB: Database> {
/// (NB: you can find the `id` of the current thread via the /// (NB: you can find the `id` of the current thread via the
/// `salsa_runtime`) /// `salsa_runtime`)
WillBlockOn { WillBlockOn {
other_id: RuntimeId, other_runtime_id: RuntimeId,
descriptor: DB::QueryDescriptor, descriptor: DB::QueryDescriptor,
}, },
@ -126,11 +126,11 @@ impl<DB: Database> fmt::Debug for EventKind<DB> {
.field("descriptor", descriptor) .field("descriptor", descriptor)
.finish(), .finish(),
EventKind::WillBlockOn { EventKind::WillBlockOn {
other_id, other_runtime_id,
descriptor, descriptor,
} => fmt } => fmt
.debug_struct("WillBlockOn") .debug_struct("WillBlockOn")
.field("other_id", other_id) .field("other_runtime_id", other_runtime_id)
.field("descriptor", descriptor) .field("descriptor", descriptor)
.finish(), .finish(),
EventKind::WillChangeInputValue { descriptor } => fmt EventKind::WillChangeInputValue { descriptor } => fmt

View file

@ -258,7 +258,7 @@ where
debug!("{:?}: execute_query_implementation invoked", descriptor); debug!("{:?}: execute_query_implementation invoked", descriptor);
db.salsa_event(|| Event { db.salsa_event(|| Event {
id: db.salsa_runtime().id(), runtime_id: db.salsa_runtime().id(),
kind: EventKind::WillExecute { kind: EventKind::WillExecute {
descriptor: descriptor.clone(), descriptor: descriptor.clone(),
}, },