Skip to content

Commit

Permalink
Auto merge of #12475 - compiler-errors:unelided-lifetime, r=epage
Browse files Browse the repository at this point in the history
Fix elided lifetime in associated const

Fix an unelided lifetime in an associated const.

The old code was equivalent to:

```rust
impl<'a> RegistryConfig {
    /// File name of [`RegistryConfig`].
    const NAME: &'a str = "config.json";
}
```

and not `&'static str`, as it might be in a regular `const` item.

This "regressed" in rust-lang/rust#97313, which started allowing this behavior (inadvertently, as far as I can tell). It's not necessarily clear to me that this is sound (or at least, it's not something we intended to be able to express), but it's also preventing me from doing crater runs to investigate fallout of this issue (rust-lang/rust#114713 and rust-lang/rust#114716).
  • Loading branch information
bors committed Aug 11, 2023
2 parents 7da1030 + b4a26b0 commit 3705df0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cargo/sources/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {

impl RegistryConfig {
/// File name of [`RegistryConfig`].
const NAME: &str = "config.json";
const NAME: &'static str = "config.json";
}

/// Get the maximum upack size that Cargo permits
Expand Down

0 comments on commit 3705df0

Please sign in to comment.