xxchan commented on code in PR #998:
URL: https://github.com/apache/iceberg-rust/pull/998#discussion_r1966793025


##########
crates/iceberg/src/scan.rs:
##########
@@ -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>> {

Review Comment:
   
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`:
   ```rust
   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`
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to