-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope #125258
Merged
Conversation
This file contains 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
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 18, 2024
compiler-errors
changed the title
Resolve elided lifetimes in assoc const to static if no other lifetim…
Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope
May 18, 2024
This comment has been minimized.
This comment has been minimized.
compiler-errors
force-pushed
the
static-if-no-lt
branch
from
May 19, 2024 02:19
130a9d0
to
2c09825
Compare
☔ The latest upstream changes (presumably #124417) made this pull request unmergeable. Please resolve the merge conflicts. |
oh lol the FCP finished a couple week ago: Let me add tests and bump this out of draft. |
compiler-errors
force-pushed
the
static-if-no-lt
branch
from
June 14, 2024 01:23
2c09825
to
e9327f1
Compare
r? compiler |
This comment has been minimized.
This comment has been minimized.
compiler-errors
force-pushed
the
static-if-no-lt
branch
from
June 14, 2024 15:05
e9327f1
to
5f3357c
Compare
This stuff is not my area of expertise but there are good comments, tests, and I don't see anything problematic. @bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jun 17, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 17, 2024
Rollup of 8 pull requests Successful merges: - rust-lang#125258 (Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope) - rust-lang#126250 (docs(change): Don't mention a Cargo 2024 edition change for 1.79) - rust-lang#126288 (doc: Added commas where needed) - rust-lang#126346 (export std::os::fd module on HermitOS) - rust-lang#126468 (div_euclid, rem_euclid: clarify/extend documentation) - rust-lang#126531 (Add codegen test for `Request::provide_*`) - rust-lang#126535 (coverage: Arrange span extraction/refinement as a series of passes) - rust-lang#126538 (coverage: Several small improvements to graph code) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 17, 2024
Rollup merge of rust-lang#125258 - compiler-errors:static-if-no-lt, r=nnethercote Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope Implements the change to elided lifetime resolution in *associated consts* subject to FCP here: rust-lang#125190 (comment) Specifically, walk the enclosing lifetime ribs in an associated const, and if we find no other lifetimes, then resolve to `'static`. Also make it work for traits, but don't lint -- just give a hard error in that case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Implements the change to elided lifetime resolution in associated consts subject to FCP here: #125190 (comment)
Specifically, walk the enclosing lifetime ribs in an associated const, and if we find no other lifetimes, then resolve to
'static
.Also make it work for traits, but don't lint -- just give a hard error in that case.