migrate most remaining crates to Rust 2024 Edition#22686
Merged
Conversation
error[E0716]: temporary value dropped while borrowed
--> ui/src/instance/prodash.rs:170:21
|
170 | w.write_fmt(format_workunit_duration_ms!(elapsed_ms))
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | creates a temporary value which is freed while still in use
| | temporary value is freed at the end of this statement
| borrow later used by call
|
= note: consider using a `let` binding to create a longer lived value
= note: this error originates in the macro `format_workunit_duration_ms` (in Nightly builds, run with -Z macro-backtrace for more info)
tdyas
commented
Sep 21, 2025
| #[macro_export] | ||
| macro_rules! format_workunit_duration_ms { | ||
| ($workunit_duration_ms:expr) => {{ format_args!("{:.2}s", ($workunit_duration_ms as f64) / 1000.0) }}; | ||
| pub fn format_workunit_duration_ms(duration: Duration) -> String { |
Contributor
Author
There was a problem hiding this comment.
I converted this a regular function because the changes to lifetimes for temporary values in Rust 2024 Edition triggered this error:
error[E0716]: temporary value dropped while borrowed
--> ui/src/instance/prodash.rs:170:21
|
170 | w.write_fmt(format_workunit_duration_ms!(elapsed_ms))
| --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | creates a temporary value which is freed while still in use
| | temporary value is freed at the end of this statement
| borrow later used by call
|
= note: consider using a `let` binding to create a longer lived value
= note: this error originates in the macro `format_workunit_duration_ms` (in Nightly builds, run with -Z macro-backtrace for more info)
Contributor
Author
|
The So |
Contributor
Author
|
https://blog.rust-lang.org/2024/09/05/impl-trait-capture-rules/ describes the lifetime capture changes for return-position |
Contributor
Author
|
|
benjyw
approved these changes
Sep 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate most of the remaining crates to Rust 2024 Edition. Basically,
task_executoris excluded from this PR due totask_executor::Executor::spawn_blockingneeding some further thought.