commit 61a5e01dde20c9d66c4c2e3468708ca91728d688
parent 78d20156e19eed76b343d45d73b8ba4ee6e2c515
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Mon, 20 Oct 2025 12:18:01 +0000
Bug 1988468 - Fix remaining mismatched_lifetime_syntaxes warnings. r=eemeli,profiler-reviewers,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D269136
Diffstat:
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/dom/webauthn/authrs_bridge/src/test_token.rs b/dom/webauthn/authrs_bridge/src/test_token.rs
@@ -174,7 +174,7 @@ impl TestToken {
}
}
- fn get_credentials(&self) -> Ref<Vec<TestTokenCredential>> {
+ fn get_credentials(&self) -> Ref<'_, Vec<TestTokenCredential>> {
self.credentials.borrow()
}
diff --git a/intl/l10n/rust/fluent-ffi/src/bundle.rs b/intl/l10n/rust/fluent-ffi/src/bundle.rs
@@ -32,11 +32,11 @@ pub struct L10nArg<'s> {
pub value: FluentArgument<'s>,
}
-fn transform_accented(s: &str) -> Cow<str> {
+fn transform_accented(s: &str) -> Cow<'_, str> {
transform_dom(s, false, true, true)
}
-fn transform_bidi(s: &str) -> Cow<str> {
+fn transform_bidi(s: &str) -> Cow<'_, str> {
transform_dom(s, false, false, false)
}
diff --git a/intl/l10n/rust/l10nregistry-rs/src/registry/mod.rs b/intl/l10n/rust/l10nregistry-rs/src/registry/mod.rs
@@ -213,7 +213,7 @@ impl<P, B> L10nRegistry<P, B> {
Ok(())
}
- pub fn try_borrow_metasources(&self) -> Result<Ref<MetaSources>, L10nRegistrySetupError> {
+ pub fn try_borrow_metasources(&self) -> Result<Ref<'_, MetaSources>, L10nRegistrySetupError> {
self.shared
.metasources
.try_borrow()
@@ -222,7 +222,7 @@ impl<P, B> L10nRegistry<P, B> {
pub fn try_borrow_metasources_mut(
&self,
- ) -> Result<RefMut<MetaSources>, L10nRegistrySetupError> {
+ ) -> Result<RefMut<'_, MetaSources>, L10nRegistrySetupError> {
self.shared
.metasources
.try_borrow_mut()
diff --git a/security/manager/ssl/trust_anchors/build.rs b/security/manager/ssl/trust_anchors/build.rs
@@ -106,7 +106,7 @@ impl PartialEq for Ck<'_> {
}
}
-fn class(i: &str) -> IResult<&str, Ck> {
+fn class(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("CK_OBJECT_CLASS")(i)?;
let (i, _) = space1(i)?;
let (i, class) = alt((
@@ -119,7 +119,7 @@ fn class(i: &str) -> IResult<&str, Ck> {
Ok((i, Ck::Class(class)))
}
-fn trust(i: &str) -> IResult<&str, Ck> {
+fn trust(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("CK_TRUST")(i)?;
let (i, _) = space1(i)?;
let (i, trust) = alt((
@@ -134,7 +134,7 @@ fn trust(i: &str) -> IResult<&str, Ck> {
// Parses a CK_BBOOL and wraps it with Ck::OptionBool so that it gets printed as
// "Some(CK_TRUE_BYTES)" instead of "CK_TRUE_BYTES".
-fn option_bbool(i: &str) -> IResult<&str, Ck> {
+fn option_bbool(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("CK_BBOOL")(i)?;
let (i, _) = space1(i)?;
let (i, b) = alt((tag("CK_TRUE"), tag("CK_FALSE")))(i)?;
@@ -143,7 +143,7 @@ fn option_bbool(i: &str) -> IResult<&str, Ck> {
Ok((i, Ck::OptionBool(b)))
}
-fn bbool_true(i: &str) -> IResult<&str, Ck> {
+fn bbool_true(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("CK_BBOOL")(i)?;
let (i, _) = space1(i)?;
let (i, _) = tag("CK_TRUE")(i)?;
@@ -152,7 +152,7 @@ fn bbool_true(i: &str) -> IResult<&str, Ck> {
Ok((i, Ck::Empty))
}
-fn bbool_false(i: &str) -> IResult<&str, Ck> {
+fn bbool_false(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("CK_BBOOL")(i)?;
let (i, _) = space1(i)?;
let (i, _) = tag("CK_FALSE")(i)?;
@@ -161,7 +161,7 @@ fn bbool_false(i: &str) -> IResult<&str, Ck> {
Ok((i, Ck::Empty))
}
-fn utf8(i: &str) -> IResult<&str, Ck> {
+fn utf8(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("UTF8")(i)?;
let (i, _) = space1(i)?;
let (i, _) = char('"')(i)?;
@@ -172,7 +172,7 @@ fn utf8(i: &str) -> IResult<&str, Ck> {
Ok((i, Ck::Utf8(utf8)))
}
-fn certificate_type(i: &str) -> IResult<&str, Ck> {
+fn certificate_type(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("CK_CERTIFICATE_TYPE")(i)?;
let (i, _) = space1(i)?;
let (i, _) = tag("CKC_X_509")(i)?;
@@ -183,7 +183,7 @@ fn certificate_type(i: &str) -> IResult<&str, Ck> {
// A CKA_NSS_{EMAIL,SERVER}_DISTRUST_AFTER line in certdata.txt is encoded either as a CK_BBOOL
// with value CK_FALSE (when there is no distrust after date) or as a MULTILINE_OCTAL block.
-fn distrust_after(i: &str) -> IResult<&str, Ck> {
+fn distrust_after(i: &str) -> IResult<&str, Ck<'_>> {
let (i, value) = alt((multiline_octal, bbool_false))(i)?;
match value {
Ck::Empty => Ok((i, Ck::DistrustAfter(None))),
@@ -201,7 +201,7 @@ fn octal_octet(i: &str) -> IResult<&str, &str> {
)))(i)
}
-fn multiline_octal(i: &str) -> IResult<&str, Ck> {
+fn multiline_octal(i: &str) -> IResult<&str, Ck<'_>> {
let (i, _) = tag("MULTILINE_OCTAL")(i)?;
let (i, _) = space0(i)?;
let (i, _) = newline(i)?;
@@ -212,7 +212,7 @@ fn multiline_octal(i: &str) -> IResult<&str, Ck> {
return Ok((i, Ck::MultilineOctal(lines)));
}
-fn distrust_comment(i: &str) -> IResult<&str, (&str, Ck)> {
+fn distrust_comment(i: &str) -> IResult<&str, (&str, Ck<'_>)> {
let (i, comment) = recognize(delimited(
alt((
tag("# For Email Distrust After: "),
@@ -224,12 +224,12 @@ fn distrust_comment(i: &str) -> IResult<&str, (&str, Ck)> {
Ok((i, ("DISTRUST_COMMENT", Ck::Comment(comment))))
}
-fn comment(i: &str) -> IResult<&str, (&str, Ck)> {
+fn comment(i: &str) -> IResult<&str, (&str, Ck<'_>)> {
let (i, comment) = recognize(many1(delimited(char('#'), not_line_ending, newline)))(i)?;
Ok((i, ("COMMENT", Ck::Comment(comment))))
}
-fn certdata_line(i: &str) -> IResult<&str, (&str, Ck)> {
+fn certdata_line(i: &str) -> IResult<&str, (&str, Ck<'_>)> {
let (i, (attr, value)) = alt((
distrust_comment, // must be listed before `comment`
comment,
@@ -286,7 +286,7 @@ fn attr<'a>(block: &'a Block, attr: &str) -> &'a Ck<'a> {
block.get(attr).unwrap_or(&Ck::Empty)
}
-fn parse(i: &str) -> IResult<&str, Vec<Block>> {
+fn parse(i: &str) -> IResult<&str, Vec<Block<'_>>> {
let mut out: Vec<Block> = vec![];
let (i, _) = take_until("BEGINDATA\n")(i)?;
let (i, _) = tag("BEGINDATA\n")(i)?;
diff --git a/tools/profiler/rust-api/src/label.rs b/tools/profiler/rust-api/src/label.rs
@@ -28,7 +28,7 @@ impl<'a> AutoProfilerLabel<'a> {
pub unsafe fn new(
label: &mut std::mem::MaybeUninit<mozilla::AutoProfilerLabel>,
category_pair: ProfilingCategoryPair,
- ) -> AutoProfilerLabel {
+ ) -> Self {
bindings::gecko_profiler_construct_label(
label.as_mut_ptr(),
category_pair.to_cpp_enum_value(),