From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] tree-wide: make hidden lifetimes explicit
Date: Mon, 3 Nov 2025 10:33:33 +0100 [thread overview]
Message-ID: <20251103093437.214556-1-f.gruenbichler@proxmox.com> (raw)
fixes mismatched-lifetime-syntaxes lint enabled by default in recent rustc versions.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
https://doc.rust-lang.org/1.90.0/rustc/lints/listing/warn-by-default.html#mismatched-lifetime-syntaxes
pbs-client/src/pxar/dir_stack.rs | 12 ++++++------
pbs-datastore/src/snapshot_reader.rs | 4 ++--
pbs-pxar-fuse/src/lib.rs | 9 +++++++--
pbs-tape/src/sg_tape.rs | 4 ++--
pbs-tools/src/crypt_config.rs | 2 +-
src/config/node.rs | 2 +-
6 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/pbs-client/src/pxar/dir_stack.rs b/pbs-client/src/pxar/dir_stack.rs
index 43c48f5a6..df5ebd630 100644
--- a/pbs-client/src/pxar/dir_stack.rs
+++ b/pbs-client/src/pxar/dir_stack.rs
@@ -36,10 +36,10 @@ impl PxarDir {
}
fn create_dir(
- &mut self,
+ &'_ mut self,
parent: RawFd,
allow_existing_dirs: bool,
- ) -> Result<BorrowedFd, Error> {
+ ) -> Result<BorrowedFd<'_>, Error> {
if let Err(err) = mkdirat(
Some(parent),
self.file_name.as_os_str(),
@@ -53,7 +53,7 @@ impl PxarDir {
self.open_dir(parent)
}
- fn open_dir(&mut self, parent: RawFd) -> Result<BorrowedFd, Error> {
+ fn open_dir(&'_ mut self, parent: RawFd) -> Result<BorrowedFd<'_>, Error> {
let dir = Dir::openat(
Some(parent),
self.file_name.as_os_str(),
@@ -68,7 +68,7 @@ impl PxarDir {
Ok(fd)
}
- pub fn try_as_borrowed_fd(&self) -> Option<BorrowedFd> {
+ pub fn try_as_borrowed_fd(&'_ self) -> Option<BorrowedFd<'_>> {
// Once `nix` adds `AsFd` support use `.as_fd()` instead.
self.dir
.as_ref()
@@ -120,7 +120,7 @@ impl PxarDirStack {
Ok(out)
}
- pub fn last_dir_fd(&mut self, allow_existing_dirs: bool) -> Result<BorrowedFd, Error> {
+ pub fn last_dir_fd(&'_ mut self, allow_existing_dirs: bool) -> Result<BorrowedFd<'_>, Error> {
// should not be possible given the way we use it:
assert!(!self.dirs.is_empty(), "PxarDirStack underrun");
@@ -147,7 +147,7 @@ impl PxarDirStack {
Ok(())
}
- pub fn root_dir_fd(&self) -> Result<BorrowedFd, Error> {
+ pub fn root_dir_fd(&'_ self) -> Result<BorrowedFd<'_>, Error> {
// should not be possible given the way we use it:
assert!(!self.dirs.is_empty(), "PxarDirStack underrun");
diff --git a/pbs-datastore/src/snapshot_reader.rs b/pbs-datastore/src/snapshot_reader.rs
index 1e6112fe8..e4608ea56 100644
--- a/pbs-datastore/src/snapshot_reader.rs
+++ b/pbs-datastore/src/snapshot_reader.rs
@@ -122,9 +122,9 @@ impl SnapshotReader {
/// Returns an iterator for all chunks not skipped by `skip_fn`.
pub fn chunk_iterator<F: Fn(&[u8; 32]) -> bool>(
- &self,
+ &'_ self,
skip_fn: F,
- ) -> Result<SnapshotChunkIterator<F>, Error> {
+ ) -> Result<SnapshotChunkIterator<'_, F>, Error> {
SnapshotChunkIterator::new(self, skip_fn)
}
}
diff --git a/pbs-pxar-fuse/src/lib.rs b/pbs-pxar-fuse/src/lib.rs
index 4322c06eb..132c6bec8 100644
--- a/pbs-pxar-fuse/src/lib.rs
+++ b/pbs-pxar-fuse/src/lib.rs
@@ -406,7 +406,7 @@ impl SessionImpl {
}
}
- fn get_lookup(&self, inode: u64) -> Result<LookupRef, Error> {
+ fn get_lookup(&'_ self, inode: u64) -> Result<LookupRef<'_>, Error> {
let lookups = self.lookups.read().unwrap();
if let Some(lookup) = lookups.get(&inode) {
return Ok(lookup.get_ref(self));
@@ -447,7 +447,12 @@ impl SessionImpl {
}
}
- fn make_lookup(&self, parent: u64, inode: u64, entry: &FileEntry) -> Result<LookupRef, Error> {
+ fn make_lookup(
+ &'_ self,
+ parent: u64,
+ inode: u64,
+ entry: &FileEntry,
+ ) -> Result<LookupRef<'_>, Error> {
let lookups = self.lookups.read().unwrap();
if let Some(lookup) = lookups.get(&inode) {
return Ok(lookup.get_ref(self));
diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs
index 15c56edfe..570dd2845 100644
--- a/pbs-tape/src/sg_tape.rs
+++ b/pbs-tape/src/sg_tape.rs
@@ -848,12 +848,12 @@ impl SgTape {
Ok(transfer_len)
}
- pub fn open_writer(&mut self) -> BlockedWriter<SgTapeWriter> {
+ pub fn open_writer(&'_ mut self) -> BlockedWriter<SgTapeWriter<'_>> {
let writer = SgTapeWriter::new(self);
BlockedWriter::new(writer)
}
- pub fn open_reader(&mut self) -> Result<BlockedReader<SgTapeReader>, BlockReadError> {
+ pub fn open_reader(&'_ mut self) -> Result<BlockedReader<SgTapeReader<'_>>, BlockReadError> {
let reader = SgTapeReader::new(self);
BlockedReader::open(reader)
}
diff --git a/pbs-tools/src/crypt_config.rs b/pbs-tools/src/crypt_config.rs
index 6ea46b577..36a75c8b8 100644
--- a/pbs-tools/src/crypt_config.rs
+++ b/pbs-tools/src/crypt_config.rs
@@ -84,7 +84,7 @@ impl CryptConfig {
}
/// Returns an openssl Signer using SHA256
- pub fn data_signer(&self) -> openssl::sign::Signer {
+ pub fn data_signer(&'_ self) -> openssl::sign::Signer<'_> {
openssl::sign::Signer::new(MessageDigest::sha256(), &self.id_pkey).unwrap()
}
diff --git a/src/config/node.rs b/src/config/node.rs
index 96d1eb40a..d2d6e383d 100644
--- a/src/config/node.rs
+++ b/src/config/node.rs
@@ -252,7 +252,7 @@ impl NodeConfig {
AcmeClient::load(&account).await
}
- pub fn acme_domains(&self) -> AcmeDomainIter {
+ pub fn acme_domains(&'_ self) -> AcmeDomainIter<'_> {
AcmeDomainIter::new(self)
}
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next reply other threads:[~2025-11-03 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 9:33 Fabian Grünbichler [this message]
2025-11-03 9:33 ` [pbs-devel] [PATCH proxmox-backup 2/2] pbs-client: fix unnecessary unwrap Fabian Grünbichler
2025-11-04 15:41 ` [pbs-devel] [PATCH proxmox-backup 1/2] tree-wide: make hidden lifetimes explicit Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251103093437.214556-1-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.