Resolve function lifetime elision on the AST#97313
Merged
bors merged 4 commits intorust-lang:masterfrom Jul 25, 2022
Merged
Conversation
Contributor
|
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
Contributor
|
Blocked on #96296. |
1fdcea8 to
9d246eb
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
9d246eb to
8123954
Compare
8123954 to
b9c8ef3
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
@bors try @rust-timer queue |
Collaborator
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Collaborator
|
⌛ Trying commit 5d4053639c6a30859f6001324667a3ec32e32f33 with merge a5ac7517e73160a094c58d00ac8f79b4935456d5... |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This was referenced Jul 25, 2022
Merged
Collaborator
|
Finished benchmarking commit (6dbae3a): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Enselic
added a commit
to cargo-public-api/cargo-public-api
that referenced
this pull request
Jul 26, 2022
Our nightly CI job [found](https://github.com/Enselic/cargo-public-api/actions/runs/2736941493) detected an upstream change which I think is caused by rust-lang/rust#97313. I tried to git bisect it but it didn't want to cooperate, so I have up. In either case, the change looks reasonable, so let's just adopt it.
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Jul 27, 2022
…r=petrochenkov Clean up HIR-based lifetime resolution Based on rust-lang#97313. Fixes rust-lang#98932. r? `@petrochenkov`
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this pull request
Jul 28, 2022
…enkov Clean up HIR-based lifetime resolution Based on rust-lang/rust#97313. Fixes #98932. r? `@petrochenkov`
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jul 28, 2022
…henkov Resolve function lifetime elision on the AST ~Based on rust-lang#97720 Lifetime elision for functions is purely syntactic in nature, so can be resolved on the AST. This PR replicates the elision logic and diagnostics on the AST, and replaces HIR-based resolution by a `delay_span_bug`. This refactor allows for more consistent diagnostics, which don't have to guess the original code from HIR. r? `@petrochenkov`
bors
added a commit
to rust-lang/cargo
that referenced
this pull request
Aug 11, 2023
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).
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Aug 21, 2023
…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.
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
Aug 22, 2023
…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.
4 tasks
bors
pushed a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 18, 2023
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #97720Lifetime elision for functions is purely syntactic in nature, so can be resolved on the AST.
This PR replicates the elision logic and diagnostics on the AST, and replaces HIR-based resolution by a
delay_span_bug.This refactor allows for more consistent diagnostics, which don't have to guess the original code from HIR.
r? @petrochenkov