Skip to content

Commit 3585384

Browse files
authored
Resolve mismatched_lifetime_syntaxes warning in cargo-bazel (#3587)
This fixes a warning when using `crates_vendor` from `@rules_rust//crate_universe:defs.bzl` inside a workspace that uses a Rust toolchain 1.89.0 or newer. Specifically I hit this in https://github.com/dtolnay/cxx/tree/ebb3d0954eee94ce9a8189cbcc508b37108a2aee. ```console dtolnay:cxx$ bazel run //third-party:vendor INFO: Analyzed target //third-party:vendor (390 packages loaded, 14191 targets configured). INFO: From Compiling Rust rlib cargo_bazel v0.17.0 (40 files) [for tool]: warning: hiding a lifetime that's elided elsewhere is confusing --> external/rules_rust+/crate_universe/src/splicing/splicer.rs:483:27 | 483 | pub(crate) fn prepare(&self) -> Result<SplicerKind> { | ^^^^^ ----------- the same lifetime is hidden here | | | the lifetime is elided here | = help: the same lifetime is referred to in inconsistent ways, making the signature confusing = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default help: use `'_` for type paths | 483 | pub(crate) fn prepare(&self) -> Result<SplicerKind<'_>> { | ++++ warning: 1 warning emitted INFO: Found 1 target... Target //third-party:vendor up-to-date: bazel-bin/third-party/vendor.sh INFO: Elapsed time: 84.754s, Critical Path: 82.69s INFO: 799 processes: 218 internal, 581 processwrapper-sandbox. INFO: Build completed successfully, 799 total actions INFO: Running command line: bazel-bin/third-party/vendor.sh ```
1 parent f57fe3d commit 3585384

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crate_universe/src/splicing/splicer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ impl Splicer {
480480
SplicerKind::new(&self.manifests, &self.splicing_manifest)?.splice(&self.workspace_dir)
481481
}
482482

483-
pub(crate) fn prepare(&self) -> Result<SplicerKind> {
483+
pub(crate) fn prepare(&self) -> Result<SplicerKind<'_>> {
484484
SplicerKind::new(&self.manifests, &self.splicing_manifest)
485485
}
486486
}

0 commit comments

Comments
 (0)