Skip to content

Commit 0d5f4a4

Browse files
zxqfd555Manul from Pathway
authored andcommitted
bump rust version to 1.92 (#9609)
GitOrigin-RevId: 0a6500de567842cddfb7db4b21eadd849709386d
1 parent 8ce7b19 commit 0d5f4a4

39 files changed

+277
-306
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "pathway"
33
version = "0.27.1"
44
edition = "2021"
55
publish = false
6-
rust-version = "1.88"
6+
rust-version = "1.92"
77
license = "BUSL-1.1"
88

99
[lib]

clippy.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# we do not export a Rust API yet
2+
avoid-breaking-exported-api = false
3+
14
[[disallowed-methods]]
25
path = "differential_dataflow::operators::Count::count"
36
reason = "use crate::dataflow::operators::MaybeTotal::count instead"
@@ -45,6 +48,3 @@ reason = "use differential_dataflow::operators::join::JoinCore::join_core instea
4548
[[disallowed-methods]]
4649
path = "differential_dataflow::operators::join::Join::semijoin"
4750
reason = "use differential_dataflow::operators::join::JoinCore::join_core instead"
48-
49-
# we do not export a Rust API yet
50-
avoid-breaking-exported-api = false

external/differential-dataflow/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
//! of the new and old counts of the old and new degrees of the affected node).
7272
7373
#![forbid(missing_docs)]
74-
#![allow(array_into_iter)]
7574

76-
// Required for deriving `Abomonation`. Note: the associated crate has not been updated in 5 years and triggers warnings starting with Rust 1.85.
77-
#![allow(non_local_definitions)]
75+
// Disabling warnings since we try to keep the forks as close to the original, while the
76+
// suggestions are applied for the principal framework library.
77+
#![allow(warnings)]
7878

7979
use std::fmt::Debug;
8080

external/timely-dataflow/communication/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@
7575
7676
#![forbid(missing_docs)]
7777

78-
// Required for deriving `Abomonation`. Note: the associated crate has not been updated in 5 years and triggers warnings starting with Rust 1.85.
79-
#![allow(non_local_definitions)]
78+
// Disabling warnings since we try to keep the forks as close to the original, while the
79+
// suggestions are applied for the principal framework library.
80+
#![allow(warnings)]
8081

8182
#[cfg(feature = "getopts")]
8283
extern crate getopts;

external/timely-dataflow/timely/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@
5757
5858
#![forbid(missing_docs)]
5959

60-
// Required for deriving `Abomonation`. Note: the associated crate has not been updated in 5 years and triggers warnings starting with Rust 1.85.
61-
#![allow(non_local_definitions)]
60+
// Disabling warnings since we try to keep the forks as close to the original, while the
61+
// suggestions are applied for the principal framework library.
62+
#![allow(warnings)]
6263

6364
#[macro_use]
6465
extern crate abomonation_derive;

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "1.88"
2+
channel = "1.92"

src/connectors/adaptors.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub struct UpsertSession<Timestamp: TimelyTimestamp + Lattice + TotalOrder> {
4444
}
4545

4646
impl<Timestamp: TimelyTimestamp + Lattice + TotalOrder> UpsertSession<Timestamp> {
47+
#[allow(clippy::wrong_self_convention)] // allowing to be consistent between implementations
4748
pub fn to_collection<S: MaybeTotalScope<MaybeTotalTimestamp = Timestamp>>(
4849
&mut self,
4950
scope: &mut S,

src/connectors/aws/dynamodb.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ pub const N_SEND_ATTEMPTS: usize = 5;
3535
#[derive(Debug, thiserror::Error)]
3636
pub enum Error {
3737
#[error("Create table error, error details: {0:?}")]
38-
CreateTableError(#[from] SdkError<CreateTableError, AwsHttpResponse>),
38+
CreateTable(#[from] SdkError<CreateTableError, AwsHttpResponse>),
3939

4040
#[error("Delete table error, error details: {0:?}")]
41-
DeleteTableError(#[from] SdkError<DeleteTableError, AwsHttpResponse>),
41+
DeleteTable(#[from] SdkError<DeleteTableError, AwsHttpResponse>),
4242

4343
#[error("Describe table error, error details: {0:?}")]
44-
DescribeTableError(#[from] SdkError<DescribeTableError, AwsHttpResponse>),
44+
DescribeTable(#[from] SdkError<DescribeTableError, AwsHttpResponse>),
4545

4646
#[error("Batch write error, error details: {0:?}")]
47-
BatchWriteError(#[from] SdkError<BatchWriteItemError, AwsHttpResponse>),
47+
BatchWrite(#[from] SdkError<BatchWriteItemError, AwsHttpResponse>),
4848
}
4949

5050
pub struct DynamoDBWriter {

src/connectors/aws/kinesis.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ use crate::retry::RetryConfig;
3232
#[derive(Debug, thiserror::Error)]
3333
pub enum Error {
3434
#[error("List shards error, error details: {0:?}")]
35-
ListShardsError(#[from] SdkError<ListShardsError, AwsHttpResponse>),
35+
ListShards(#[from] SdkError<ListShardsError, AwsHttpResponse>),
3636

3737
#[error("List streams error, error details: {0:?}")]
38-
ListStreamsError(#[from] SdkError<ListStreamsError, AwsHttpResponse>),
38+
ListStreams(#[from] SdkError<ListStreamsError, AwsHttpResponse>),
3939

4040
#[error("Describe stream error, error details: {0:?}")]
41-
DescribeStreamSummaryError(#[from] SdkError<DescribeStreamSummaryError, AwsHttpResponse>),
41+
DescribeStreamSummary(#[from] SdkError<DescribeStreamSummaryError, AwsHttpResponse>),
4242

4343
#[error("Get shard iterator error, error details: {0:?}")]
44-
GetShardIteratorError(#[from] SdkError<GetShardIteratorError, AwsHttpResponse>),
44+
GetShardIterator(#[from] SdkError<GetShardIteratorError, AwsHttpResponse>),
4545

4646
#[error("Get shard records error, error details: {0:?}")]
47-
GetShardRecordsError(#[from] SdkError<GetRecordsError, AwsHttpResponse>),
47+
GetShardRecords(#[from] SdkError<GetRecordsError, AwsHttpResponse>),
4848

4949
#[error("Put records error, error details: {0:?}")]
50-
PutRecordsError(#[from] SdkError<PutRecordsError, AwsHttpResponse>),
50+
PutRecords(#[from] SdkError<PutRecordsError, AwsHttpResponse>),
5151

5252
#[error("Iterator not found for shard {0}")]
5353
IteratorNotFound(String),
@@ -212,7 +212,11 @@ impl ShardSet {
212212
// Update, case 1: we've read everything we could.
213213
let iteration_elapsed = self.last_updated_at.elapsed();
214214
if iteration_elapsed < self.round_robin_duration {
215-
std::thread::sleep(self.round_robin_duration - iteration_elapsed);
215+
std::thread::sleep(
216+
self.round_robin_duration
217+
.checked_sub(iteration_elapsed)
218+
.unwrap(),
219+
);
216220
}
217221
update_is_needed = true;
218222
} else if self.had_full_round_robin
@@ -318,7 +322,7 @@ impl KinesisReader {
318322
let response = iterator_builder
319323
.send()
320324
.await
321-
.map_err(Error::GetShardIteratorError)?;
325+
.map_err(Error::GetShardIterator)?;
322326
let iterator = response
323327
.shard_iterator()
324328
.ok_or(Error::IteratorNotFound(shard_id.to_string()))?
@@ -347,7 +351,7 @@ impl Reader for KinesisReader {
347351
let mut shard_closing_offsets: HashMap<String, String> = HashMap::new();
348352
for shard in &self.operated_set.assigned_shards {
349353
if let Some(last_record_id) = &shard.last_record_id {
350-
shard_closing_offsets.insert(shard.shard_id.clone(), last_record_id.to_string());
354+
shard_closing_offsets.insert(shard.shard_id.clone(), last_record_id.clone());
351355
}
352356
}
353357

@@ -365,7 +369,7 @@ impl Reader for KinesisReader {
365369
continue;
366370
};
367371
self.shard_offsets
368-
.insert(shard_id.to_string(), offset.to_string());
372+
.insert(shard_id.to_string(), offset.clone());
369373
if let Some(closing_offset) = shard_closing_offsets.get(shard_id.as_str()) {
370374
if closing_offset == offset {
371375
self.operated_set
@@ -577,7 +581,7 @@ impl KinesisWriter {
577581
.stream_name(stream_name)
578582
.send()
579583
.await
580-
.map_err(Error::DescribeStreamSummaryError)?;
584+
.map_err(Error::DescribeStreamSummary)?;
581585
let stream_status = stream
582586
.stream_description_summary()
583587
.ok_or(Error::StreamDoesntExist(stream_name.clone()))?
@@ -595,7 +599,7 @@ impl KinesisWriter {
595599
.limit(1)
596600
.send()
597601
.await
598-
.map_err(Error::ListStreamsError)?;
602+
.map_err(Error::ListStreams)?;
599603
}
600604
}
601605
Ok::<_, Error>(())

src/connectors/backlog.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ impl BacklogTracker {
3737
}
3838
}
3939

40-
pub fn on_event(&mut self, timestamp: &Timestamp) {
40+
pub fn on_event(&mut self, timestamp: Timestamp) {
4141
self.total_in_fly += 1;
4242
match self.backlog.back_mut() {
43-
Some(entry) if entry.timestamp == *timestamp => entry.on_event(),
44-
_ => self.backlog.push_back(BacklogEntry::new(*timestamp)),
43+
Some(entry) if entry.timestamp == timestamp => entry.on_event(),
44+
_ => self.backlog.push_back(BacklogEntry::new(timestamp)),
4545
}
4646
}
4747

0 commit comments

Comments
 (0)