ownserver
ownserver copied to clipboard
Bump metrics from 0.24.1 to 0.24.5 to fix build on recent rustc
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 buildonrustc 1.94.1reproduces the failure onmain - [x]
cargo buildsucceeds after the bump