Skip to content

Comments

refactor(linter): loosen lifetime requirements on RuntimeFileSystem::read_to_arena_str#18770

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-30-refactor_linter_loosen_lifetime_requirements_on_runtimefilesystem_read_to_arena_str_
Jan 31, 2026
Merged

refactor(linter): loosen lifetime requirements on RuntimeFileSystem::read_to_arena_str#18770
graphite-app[bot] merged 1 commit intomainfrom
om/01-30-refactor_linter_loosen_lifetime_requirements_on_runtimefilesystem_read_to_arena_str_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 31, 2026

Follow-on after #17840. After that PR we can loosen the lifetime requirements on RuntimeFileSystem::read_to_arena_str. All implementations now read/copy the source text into Allocator, so &self no longer needs to be &'a self - lifetime of the returned &str depends only on lifetime of the &'a Allocator.

@github-actions github-actions bot added A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jan 31, 2026
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@overlookmotel overlookmotel marked this pull request as ready for review January 31, 2026 14:08
Copilot AI review requested due to automatic review settings January 31, 2026 14:08
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 31, 2026
Copy link
Contributor

camc314 commented Jan 31, 2026

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the lifetime requirements on RuntimeFileSystem::read_to_arena_str by removing the constraint that the returned string's lifetime is tied to the RuntimeFileSystem instance. Since all implementations copy the source text into the Allocator, the lifetime of the returned &str only depends on the Allocator, not the file system object.

Changes:

  • Changed trait method signature to use &self instead of &'a self
  • Updated function parameters that use RuntimeFileSystem to remove unnecessary 'a lifetime constraints
  • Applied changes consistently to helper functions and internal methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 31, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing om/01-30-refactor_linter_loosen_lifetime_requirements_on_runtimefilesystem_read_to_arena_str_ (8e957b8) with main (358b2c1)1

Summary

✅ 46 untouched benchmarks
⏩ 3 skipped benchmarks2

Footnotes

  1. No successful run was found on main (772ea70) during the generation of this report, so 358b2c1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

…:read_to_arena_str` (#18770)

Follow-on after #17840. After that PR we can loosen the lifetime requirements on `RuntimeFileSystem::read_to_arena_str`. All implementations now read/copy the source text into `Allocator`, so `&self` no longer needs to be `&'a self` - lifetime of the returned `&str` depends only on lifetime of the `&'a Allocator`.
@graphite-app graphite-app bot force-pushed the om/01-30-refactor_linter_loosen_lifetime_requirements_on_runtimefilesystem_read_to_arena_str_ branch from 8e957b8 to 5f905e5 Compare January 31, 2026 14:11
@graphite-app graphite-app bot merged commit 5f905e5 into main Jan 31, 2026
21 checks passed
@graphite-app graphite-app bot deleted the om/01-30-refactor_linter_loosen_lifetime_requirements_on_runtimefilesystem_read_to_arena_str_ branch January 31, 2026 14:16
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants