Skip to content

Commit 99ac1de

Browse files
markbtfacebook-github-bot
authored andcommitted
fix or allow elided_named_lifetimes warning
Summary: There are a couple of places where we were relying on elided lifetimes implicity matching with an already-named lifetime. This is now a warning, so let's stop doing that. For `hgproto::sshproto::request`, this comes from the use of `nom` macros, so suppress the warning there. For `derived_data_manager::manager::derive`, we were matching on the lifetime added by `async_recursion`, so we need to explicitly name the lifetime to get around this. Reviewed By: mitrandir77, RajivTS Differential Revision: D67735986 fbshipit-source-id: da58202d48859bd0238704e8e8ce9e8a84093ddf
1 parent b1f19b2 commit 99ac1de

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

eden/mononoke/cmdlib/src/args/matches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ impl<'a> MononokeMatches<'a> {
297297
self.matches.is_present(name)
298298
}
299299

300-
pub fn subcommand(&'a self) -> (&str, Option<&'a ArgMatches<'a>>) {
300+
pub fn subcommand(&self) -> (&str, Option<&ArgMatches<'a>>) {
301301
self.matches.subcommand()
302302
}
303303

eden/mononoke/derived_data/manager/manager/derive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ impl DerivedDataManager {
9191
#[async_recursion]
9292
/// Returns the appropriate manager to derive given changeset, either this
9393
/// manager, or some secondary manager in the chain.
94-
async fn get_manager(
95-
&self,
94+
async fn get_manager<'s>(
95+
&'s self,
9696
ctx: &CoreContext,
9797
cs_id: ChangesetId,
98-
) -> anyhow::Result<&DerivedDataManager> {
98+
) -> anyhow::Result<&'s DerivedDataManager> {
9999
Ok(if let Some(secondary) = &self.inner.secondary {
100100
if secondary
101101
.assigner

eden/mononoke/hgproto/src/sshproto/request.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* GNU General Public License version 2.
66
*/
77

8+
#![allow(elided_named_lifetimes)]
9+
810
use std::collections::HashMap;
911
use std::iter;
1012
use std::str;

eden/mononoke/mononoke_types/src/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,14 +909,14 @@ impl AsRef<[MPathElement]> for NonRootMPath {
909909

910910
pub fn non_root_mpath_element_iter<'a>(
911911
mpath: &'a Option<NonRootMPath>,
912-
) -> Box<dyn Iterator<Item = &MPathElement> + 'a> {
912+
) -> Box<dyn Iterator<Item = &'a MPathElement> + 'a> {
913913
match mpath {
914914
Some(path) => Box::new(path.into_iter()),
915915
None => Box::new(std::iter::empty()),
916916
}
917917
}
918918

919-
pub fn mpath_element_iter<'a>(mpath: &'a MPath) -> Box<dyn Iterator<Item = &MPathElement> + 'a> {
919+
pub fn mpath_element_iter<'a>(mpath: &'a MPath) -> Box<dyn Iterator<Item = &'a MPathElement> + 'a> {
920920
Box::new(mpath.into_iter())
921921
}
922922

@@ -1264,7 +1264,7 @@ pub struct CaseConflictTrie<'a> {
12641264
}
12651265

12661266
impl<'a> CaseConflictTrie<'a> {
1267-
fn new(exclusions: &'a PrefixTrie) -> CaseConflictTrie {
1267+
fn new(exclusions: &'a PrefixTrie) -> CaseConflictTrie<'a> {
12681268
CaseConflictTrie {
12691269
children: Default::default(),
12701270
lowercase_to_original: Default::default(),

0 commit comments

Comments
 (0)