Skip to content

Commit

Permalink
Auto merge of #14487 - ehuss:fix-elided-lifetime, r=epage
Browse files Browse the repository at this point in the history
Fix elided lifetime

This fixes an issue with the recent nightly that has added a lint (rust-lang/rust#129207) that warns about the lack of a lifetime, which looks like:

```
warning: elided lifetime has a name
   --> src/cargo/core/workspace.rs:580:66
    |
580 |     pub fn default_members<'a>(&'a self) -> impl Iterator<Item = &Package> {
    |                            -- lifetime `'a` declared here        ^ this elided lifetime gets resolved as `'a`
    |
    = note: `#[warn(elided_named_lifetimes)]` on by default
```
  • Loading branch information
bors committed Sep 2, 2024
2 parents cf88141 + 2597cdf commit ee6f1c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ impl<'gctx> Workspace<'gctx> {
}

/// Returns an iterator over default packages in this workspace
pub fn default_members<'a>(&'a self) -> impl Iterator<Item = &Package> {
pub fn default_members<'a>(&'a self) -> impl Iterator<Item = &'a Package> {
let packages = &self.packages;
self.default_members
.iter()
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/lints/implicit_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ unused_optional_dependency = "allow"
.masquerade_as_nightly_cargo(&["cargo-lints", "edition2024"])
.with_stderr_data(str![[r#"
[UPDATING] `dummy-registry` index
[LOCKING] 1 package to latest Rust 1.82.0-nightly compatible version
[LOCKING] 1 package to latest Rust 1.[..] compatible version
[CHECKING] foo v0.1.0 ([ROOT]/foo)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
Expand Down

0 comments on commit ee6f1c8

Please sign in to comment.