ownserver icon indicating copy to clipboard operation
ownserver copied to clipboard

Bump metrics from 0.24.1 to 0.24.5 to fix build on recent rustc

Open MiniHarinn opened this issue 6 months ago • 0 comments

metrics 0.24.1, the version currently pinned in Cargo.lock, fails to compile on recent rustc (1.94 in my repro, but anything that picked up the change in rust-lang/rust#141402 is affected):

error[E0521]: borrowed data escapes outside of associated function
   --> metrics-0.24.1/src/recorder/mod.rs:149:13
    |
140 | impl<'a> LocalRecorderGuard<'a> {
    |      -- lifetime `'a` defined here
141 |     /// Creates a new `LocalRecorderGuard` and sets the thread-local recorder.
142 |     fn new(recorder: &'a dyn Recorder) -> Self {
    |            -------- `recorder` is a reference that is only valid in the associated function body
...
149 |             LOCAL_RECORDER.with(|local_recorder| local_recorder.replace(Some(recorder_ptr)));
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |             |
    |             `recorder` escapes the associated function body here
    |             argument requires that `'a` must outlive `'static`
note: raw pointer casts of trait objects cannot extend lifetimes
   --> metrics-0.24.1/src/recorder/mod.rs:146:60

This was fixed upstream in metrics 0.24.2. Bumping the lockfile to 0.24.5 (currently the latest in the 0.24.x line) restores the build. Cargo.toml's ^0.24 constraint already permits it, so no manifest change is required, just cargo update -p metrics --precise 0.24.5.

Test

  • [x] cargo build on rustc 1.94.1 reproduces the failure on main
  • [x] cargo build succeeds after the bump

MiniHarinn avatar May 06 '26 13:05 MiniHarinn