Skip to content

Commit 4147948

Browse files
authored
Rust 1.89 compatibility (#634)
We need to name anonymous lifetimes in more places. Signed-off-by: Moritz Hoffmann <[email protected]>
1 parent 94f562e commit 4147948

File tree

12 files changed

+47
-47
lines changed

12 files changed

+47
-47
lines changed

differential-dataflow/examples/columnar.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@ mod container {
159159
type BorrowedOf<'a, C> = <<C as Columnar>::Container as columnar::Container>::Borrowed<'a>;
160160

161161
impl<C: Columnar> Column<C> {
162-
pub fn borrow(&self) -> BorrowedOf<C> {
162+
pub fn borrow(&self) -> BorrowedOf<'_, C> {
163163
match self {
164164
Column::Typed(t) => t.borrow(),
165165
Column::Bytes(b) => <BorrowedOf<C> as FromBytes>::from_bytes(&mut Indexed::decode(bytemuck::cast_slice(b))),
166166
Column::Align(a) => <BorrowedOf<C> as FromBytes>::from_bytes(&mut Indexed::decode(a)),
167167
}
168168
}
169-
pub fn get(&self, index: usize) -> columnar::Ref<C> {
169+
pub fn get(&self, index: usize) -> columnar::Ref<'_, C> {
170170
self.borrow().get(index)
171171
}
172172
}
@@ -493,7 +493,7 @@ pub mod batcher {
493493
for<'b> columnar::Ref<'b, T>: Ord,
494494
R: Columnar,
495495
{
496-
fn next_or_alloc(&mut self) -> Result<columnar::Ref<(D, T, R)>, Column<(D, T, R)>> {
496+
fn next_or_alloc(&mut self) -> Result<columnar::Ref<'_, (D, T, R)>, Column<(D, T, R)>> {
497497
if self.is_empty() {
498498
Err(std::mem::take(&mut self.list))
499499
}
@@ -517,12 +517,12 @@ pub mod batcher {
517517
}
518518

519519
impl<T: Columnar> ColumnQueue<T> {
520-
fn pop(&mut self) -> columnar::Ref<T> {
520+
fn pop(&mut self) -> columnar::Ref<'_, T> {
521521
self.head += 1;
522522
self.list.get(self.head - 1)
523523
}
524524

525-
fn peek(&self) -> columnar::Ref<T> {
525+
fn peek(&self) -> columnar::Ref<'_, T> {
526526
self.list.get(self.head)
527527
}
528528
}

differential-dataflow/src/operators/arrange/agent.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ impl<Tr: TraceReader> TraceReader for TraceAgent<Tr> {
5555
::std::mem::swap(&mut self.logical_compaction, &mut self.temp_antichain);
5656
self.temp_antichain.clear();
5757
}
58-
fn get_logical_compaction(&mut self) -> AntichainRef<Tr::Time> {
58+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> {
5959
self.logical_compaction.borrow()
6060
}
61-
fn set_physical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) {
61+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) {
6262
// This method does not enforce that `frontier` is greater or equal to `self.physical_compaction`.
6363
// Instead, it determines the joint consequences of both guarantees and moves forward with that.
6464
crate::lattice::antichain_join_into(&self.physical_compaction.borrow()[..], &frontier[..], &mut self.temp_antichain);
6565
self.trace.borrow_mut().adjust_physical_compaction(self.physical_compaction.borrow(), self.temp_antichain.borrow());
6666
::std::mem::swap(&mut self.physical_compaction, &mut self.temp_antichain);
6767
self.temp_antichain.clear();
6868
}
69-
fn get_physical_compaction(&mut self) -> AntichainRef<Tr::Time> {
69+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> {
7070
self.physical_compaction.borrow()
7171
}
72-
fn cursor_through(&mut self, frontier: AntichainRef<Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
72+
fn cursor_through(&mut self, frontier: AntichainRef<'_, Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
7373
self.trace.borrow_mut().trace.cursor_through(frontier)
7474
}
7575
fn map_batches<F: FnMut(&Self::Batch)>(&self, f: F) { self.trace.borrow().trace.map_batches(f) }

differential-dataflow/src/trace/implementations/merge_batcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ where
121121

122122
/// The frontier of elements remaining after the most recent call to `self.seal`.
123123
#[inline]
124-
fn frontier(&mut self) -> AntichainRef<M::Time> {
124+
fn frontier(&mut self) -> AntichainRef<'_, M::Time> {
125125
self.frontier.borrow()
126126
}
127127
}

differential-dataflow/src/trace/implementations/spine_fueled.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@ impl<B: Batch+Clone+'static> TraceReader for Spine<B> {
211211
self.logical_frontier.extend(frontier.iter().cloned());
212212
}
213213
#[inline]
214-
fn get_logical_compaction(&mut self) -> AntichainRef<B::Time> { self.logical_frontier.borrow() }
214+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, B::Time> { self.logical_frontier.borrow() }
215215
#[inline]
216-
fn set_physical_compaction(&mut self, frontier: AntichainRef<B::Time>) {
216+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, B::Time>) {
217217
// We should never request to rewind the frontier.
218218
debug_assert!(PartialOrder::less_equal(&self.physical_frontier.borrow(), &frontier), "FAIL\tthrough frontier !<= new frontier {:?} {:?}\n", self.physical_frontier, frontier);
219219
self.physical_frontier.clear();
220220
self.physical_frontier.extend(frontier.iter().cloned());
221221
self.consider_merges();
222222
}
223223
#[inline]
224-
fn get_physical_compaction(&mut self) -> AntichainRef<B::Time> { self.physical_frontier.borrow() }
224+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, B::Time> { self.physical_frontier.borrow() }
225225

226226
#[inline]
227227
fn map_batches<F: FnMut(&Self::Batch)>(&self, mut f: F) {

differential-dataflow/src/trace/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub trait TraceReader : LayoutExt {
133133
/// not beyond this frontier will present as a time that compares identically with all query times beyond
134134
/// this frontier. Practically, update times not beyond this frontier should not be taken to be accurate as
135135
/// presented, and should be used carefully, only in accumulation to times that are beyond the frontier.
136-
fn get_logical_compaction(&mut self) -> AntichainRef<Self::Time>;
136+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, Self::Time>;
137137

138138
/// Advances the frontier that constrains physical compaction.
139139
///
@@ -149,15 +149,15 @@ pub trait TraceReader : LayoutExt {
149149
///
150150
/// It is an error to call this method with a frontier not equal to or beyond the most recent arguments to
151151
/// this method, or the initial value of `get_physical_compaction()` if this method has not yet been called.
152-
fn set_physical_compaction(&mut self, frontier: AntichainRef<Self::Time>);
152+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Self::Time>);
153153

154154
/// Reports the physical compaction frontier.
155155
///
156156
/// All batches containing updates beyond this frontier will not be merged with other batches. This allows
157157
/// the caller to create a cursor through any frontier beyond the physical compaction frontier, with the
158158
/// `cursor_through()` method. This functionality is primarily of interest to the `join` operator, and any
159159
/// other operators who need to take notice of the physical structure of update batches.
160-
fn get_physical_compaction(&mut self) -> AntichainRef<Self::Time>;
160+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, Self::Time>;
161161

162162
/// Maps logic across the non-empty sequence of batches in the trace.
163163
///
@@ -314,7 +314,7 @@ pub trait Batcher {
314314
/// Returns all updates not greater or equal to an element of `upper`.
315315
fn seal<B: Builder<Input=Self::Output, Time=Self::Time>>(&mut self, upper: Antichain<Self::Time>) -> B::Output;
316316
/// Returns the lower envelope of contained update times.
317-
fn frontier(&mut self) -> timely::progress::frontier::AntichainRef<Self::Time>;
317+
fn frontier(&mut self) -> AntichainRef<'_, Self::Time>;
318318
}
319319

320320
/// Functionality for building batches from ordered update sequences.

differential-dataflow/src/trace/wrappers/enter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,29 @@ where
5454
})
5555
}
5656

57-
fn set_logical_compaction(&mut self, frontier: AntichainRef<TInner>) {
57+
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, TInner>) {
5858
self.stash1.clear();
5959
for time in frontier.iter() {
6060
self.stash1.insert(time.clone().to_outer());
6161
}
6262
self.trace.set_logical_compaction(self.stash1.borrow());
6363
}
64-
fn get_logical_compaction(&mut self) -> AntichainRef<TInner> {
64+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, TInner> {
6565
self.stash2.clear();
6666
for time in self.trace.get_logical_compaction().iter() {
6767
self.stash2.insert(TInner::to_inner(time.clone()));
6868
}
6969
self.stash2.borrow()
7070
}
7171

72-
fn set_physical_compaction(&mut self, frontier: AntichainRef<TInner>) {
72+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, TInner>) {
7373
self.stash1.clear();
7474
for time in frontier.iter() {
7575
self.stash1.insert(time.clone().to_outer());
7676
}
7777
self.trace.set_physical_compaction(self.stash1.borrow());
7878
}
79-
fn get_physical_compaction(&mut self) -> AntichainRef<TInner> {
79+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, TInner> {
8080
self.stash2.clear();
8181
for time in self.trace.get_physical_compaction().iter() {
8282
self.stash2.insert(TInner::to_inner(time.clone()));

differential-dataflow/src/trace/wrappers/enter_at.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,29 +75,29 @@ where
7575
})
7676
}
7777

78-
fn set_logical_compaction(&mut self, frontier: AntichainRef<TInner>) {
78+
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, TInner>) {
7979
self.stash1.clear();
8080
for time in frontier.iter() {
8181
self.stash1.insert((self.prior)(time));
8282
}
8383
self.trace.set_logical_compaction(self.stash1.borrow());
8484
}
85-
fn get_logical_compaction(&mut self) -> AntichainRef<TInner> {
85+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, TInner> {
8686
self.stash2.clear();
8787
for time in self.trace.get_logical_compaction().iter() {
8888
self.stash2.insert(TInner::to_inner(time.clone()));
8989
}
9090
self.stash2.borrow()
9191
}
9292

93-
fn set_physical_compaction(&mut self, frontier: AntichainRef<TInner>) {
93+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, TInner>) {
9494
self.stash1.clear();
9595
for time in frontier.iter() {
9696
self.stash1.insert((self.prior)(time));
9797
}
9898
self.trace.set_physical_compaction(self.stash1.borrow());
9999
}
100-
fn get_physical_compaction(&mut self) -> AntichainRef<TInner> {
100+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, TInner> {
101101
self.stash2.clear();
102102
for time in self.trace.get_physical_compaction().iter() {
103103
self.stash2.insert(TInner::to_inner(time.clone()));

differential-dataflow/src/trace/wrappers/filter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ where
4343
.map_batches(|batch| f(&Self::Batch::make_from(batch.clone(), logic.clone())))
4444
}
4545

46-
fn set_logical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) { self.trace.set_logical_compaction(frontier) }
47-
fn get_logical_compaction(&mut self) -> AntichainRef<Tr::Time> { self.trace.get_logical_compaction() }
46+
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) { self.trace.set_logical_compaction(frontier) }
47+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> { self.trace.get_logical_compaction() }
4848

49-
fn set_physical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) { self.trace.set_physical_compaction(frontier) }
50-
fn get_physical_compaction(&mut self) -> AntichainRef<Tr::Time> { self.trace.get_physical_compaction() }
49+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) { self.trace.set_physical_compaction(frontier) }
50+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> { self.trace.get_physical_compaction() }
5151

52-
fn cursor_through(&mut self, upper: AntichainRef<Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
52+
fn cursor_through(&mut self, upper: AntichainRef<'_, Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
5353
self.trace.cursor_through(upper).map(|(x,y)| (CursorFilter::new(x, self.logic.clone()), y))
5454
}
5555
}

differential-dataflow/src/trace/wrappers/freeze.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ where
9999
})
100100
}
101101

102-
fn set_logical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) { self.trace.set_logical_compaction(frontier) }
103-
fn get_logical_compaction(&mut self) -> AntichainRef<Tr::Time> { self.trace.get_logical_compaction() }
102+
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) { self.trace.set_logical_compaction(frontier) }
103+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> { self.trace.get_logical_compaction() }
104104

105-
fn set_physical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) { self.trace.set_physical_compaction(frontier) }
106-
fn get_physical_compaction(&mut self) -> AntichainRef<Tr::Time> { self.trace.get_physical_compaction() }
105+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) { self.trace.set_physical_compaction(frontier) }
106+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> { self.trace.get_physical_compaction() }
107107

108-
fn cursor_through(&mut self, upper: AntichainRef<Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
108+
fn cursor_through(&mut self, upper: AntichainRef<'_, Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
109109
let func = &self.func;
110110
self.trace.cursor_through(upper)
111111
.map(|(cursor, storage)| (CursorFreeze::new(cursor, func.clone()), storage))

differential-dataflow/src/trace/wrappers/frontier.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ impl<Tr: TraceReader> TraceReader for TraceFrontier<Tr> {
5353
self.trace.map_batches(|batch| f(&Self::Batch::make_from(batch.clone(), since, until)))
5454
}
5555

56-
fn set_logical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) { self.trace.set_logical_compaction(frontier) }
57-
fn get_logical_compaction(&mut self) -> AntichainRef<Tr::Time> { self.trace.get_logical_compaction() }
56+
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) { self.trace.set_logical_compaction(frontier) }
57+
fn get_logical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> { self.trace.get_logical_compaction() }
5858

59-
fn set_physical_compaction(&mut self, frontier: AntichainRef<Tr::Time>) { self.trace.set_physical_compaction(frontier) }
60-
fn get_physical_compaction(&mut self) -> AntichainRef<Tr::Time> { self.trace.get_physical_compaction() }
59+
fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>) { self.trace.set_physical_compaction(frontier) }
60+
fn get_physical_compaction(&mut self) -> AntichainRef<'_, Tr::Time> { self.trace.get_physical_compaction() }
6161

62-
fn cursor_through(&mut self, upper: AntichainRef<Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
62+
fn cursor_through(&mut self, upper: AntichainRef<'_, Tr::Time>) -> Option<(Self::Cursor, Self::Storage)> {
6363
let since = self.since.borrow();
6464
let until = self.until.borrow();
6565
self.trace.cursor_through(upper).map(|(x,y)| (CursorFrontier::new(x, since, until), y))
@@ -68,7 +68,7 @@ impl<Tr: TraceReader> TraceReader for TraceFrontier<Tr> {
6868

6969
impl<Tr: TraceReader> TraceFrontier<Tr> {
7070
/// Makes a new trace wrapper
71-
pub fn make_from(trace: Tr, since: AntichainRef<Tr::Time>, until: AntichainRef<Tr::Time>) -> Self {
71+
pub fn make_from(trace: Tr, since: AntichainRef<'_, Tr::Time>, until: AntichainRef<'_, Tr::Time>) -> Self {
7272
TraceFrontier {
7373
trace,
7474
since: since.to_owned(),

0 commit comments

Comments
 (0)