Skip to content

Commit 3705df0

Browse files
committed
Auto merge of #12475 - compiler-errors:unelided-lifetime, r=epage
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).
2 parents 7da1030 + b4a26b0 commit 3705df0

File tree

1 file changed

+1
-1
lines changed
  • src/cargo/sources/registry

1 file changed

+1
-1
lines changed

src/cargo/sources/registry/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
887887

888888
impl RegistryConfig {
889889
/// File name of [`RegistryConfig`].
890-
const NAME: &str = "config.json";
890+
const NAME: &'static str = "config.json";
891891
}
892892

893893
/// Get the maximum upack size that Cargo permits

0 commit comments

Comments
 (0)