Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix edition 2024 compile errors #998

Merged
merged 2 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/iceberg/src/arrow/record_batch_transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ impl RecordBatchTransformer {
Ok(match &self.batch_transform {
Some(BatchTransform::PassThrough) => record_batch,
Some(BatchTransform::Modify {
ref target_schema,
ref operations,
target_schema,
operations,
Comment on lines -143 to +144
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}) => {
let options = RecordBatchOptions::default()
.with_match_field_names(false)
Expand Down Expand Up @@ -294,7 +294,7 @@ impl RecordBatchTransformer {
Error::new(ErrorKind::Unexpected, "Field not found in snapshot schema")
)?;

let default_value = if let Some(ref iceberg_default_value) =
let default_value = if let Some(iceberg_default_value) =
&iceberg_field.initial_default
{
let Literal::Primitive(primitive_literal) = iceberg_default_value else {
Expand Down
6 changes: 3 additions & 3 deletions crates/iceberg/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,8 @@ impl TableScan {

if let Some(ref bound_predicates) = manifest_entry_context.bound_predicates {
let BoundPredicates {
ref snapshot_bound_predicate,
ref partition_bound_predicate,
snapshot_bound_predicate,
partition_bound_predicate,
} = bound_predicates.as_ref();

let expression_evaluator_cache =
Expand Down Expand Up @@ -733,7 +733,7 @@ impl PlanContext {
manifest_list: Arc<ManifestList>,
tx_data: Sender<ManifestEntryContext>,
delete_file_idx_and_tx: Option<(DeleteFileIndex, Sender<ManifestEntryContext>)>,
) -> Result<Box<impl Iterator<Item = Result<ManifestFileContext>>>> {
) -> Result<Box<impl Iterator<Item = Result<ManifestFileContext>> + 'static>> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html#edition-specific-rules-when-no-use-bound-is-present

In edition 2024, the RPIT will capture 'self

And causing error at spawn:

error[E0521]: borrowed data escapes outside of method
   --> crates/iceberg/src/scan.rs:402:9
    |
365 |       pub async fn plan_files(&self) -> Result<FileScanTaskStream> {
    |                               -----
    |                               |
    |                               `self` is a reference that is only valid in the method body
    |                               let's call the lifetime of this reference `'1`
...
402 | /         spawn(async move {
403 | |             let result = futures::stream::iter(manifest_file_contexts)
404 | |                 .try_for_each_concurrent(concurrency_limit_manifest_files, |ctx| async move {
405 | |                     ctx.fetch_manifest_and_stream_manifest_entries().await
...   |
412 | |         });
    | |          ^
    | |          |
    | |__________`self` escapes the method body here
    |            argument requires that `'1` must outlive `'static`

let manifest_files = manifest_list.entries().iter();

// TODO: Ideally we could ditch this intermediate Vec as we return an iterator.
Expand Down
Loading