Skip to content

Commit

Permalink
Rollup merge of rust-lang#115011 - compiler-errors:warn-on-elided-ass…
Browse files Browse the repository at this point in the history
…oc-ct-lt, r=cjgillot

Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`)

Elided lifetimes in associated constants (in impls) erroneously resolve to fresh lifetime parameters on the impl since rust-lang#97313. This is not correct behavior (see rust-lang#38831).

I originally opened rust-lang#114716 to fix this, but given the time that has passed, the crater results seem pretty bad: rust-lang#114716 (comment)

This PR alternatively implements a lint against this behavior, and I'm hoping to bump this to deny in a few versions.
  • Loading branch information
compiler-errors committed Aug 22, 2023
2 parents 30d8aa1 + 7012fff commit ce0eeee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/test-utils/src/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl FixtureWithProjectMeta {
}

impl MiniCore {
const RAW_SOURCE: &str = include_str!("./minicore.rs");
const RAW_SOURCE: &'static str = include_str!("./minicore.rs");

fn has_flag(&self, flag: &str) -> bool {
self.activated_flags.iter().any(|it| it == flag)
Expand Down

0 comments on commit ce0eeee

Please sign in to comment.