Skip to content
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

Allow eliding GATs in expression position #92918

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

compiler-errors
Copy link
Member

Thoughts on whether this is worthwhile?

Fixes #92836

r? @jackh726

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 15, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 15, 2022
tcx.sess
.delay_span_bug(self.span, "unelided lifetime in signature");

// Supply some dummy value. We don't have an
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy-pasta'ed this from elsewhere in astconv.

@rust-log-analyzer

This comment has been minimized.

@jackh726
Copy link
Member

Will this change the lifetime we pick for something like <Self as Trait>::Assoc, where the definition of Trait has a lifetime?

@compiler-errors
Copy link
Member Author

seems like (at least in expr position) we already unelide <T as Trait> into <T as Trait<'_>> where '_ is a region variable: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d7ad0075064708258efbbb34d2b88c3f

so I don't... think so?

@jackh726
Copy link
Member

This makes sense; lifetime elision is allowed here for non-GATs

@bors r+

@bors
Copy link
Contributor

bors commented Jan 30, 2022

📌 Commit d671948 has been approved by jackh726

@bors 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 Jan 30, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 30, 2022
…lision, r=jackh726

Allow eliding GATs in expression position

Thoughts on whether this is worthwhile?

Fixes rust-lang#92836

r? `@jackh726`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 31, 2022
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#90277 (Improve terminology around "after typeck")
 - rust-lang#92918 (Allow eliding GATs in expression position)
 - rust-lang#93039 (Don't suggest inaccessible fields)
 - rust-lang#93155 (Switch pretty printer to block-based indentation)
 - rust-lang#93214 (Respect doc(hidden) when suggesting available fields)
 - rust-lang#93347 (Make `char::DecodeUtf16::size_hist` more precise)
 - rust-lang#93392 (Clarify documentation on char::MAX)
 - rust-lang#93444 (Fix some CSS warnings and errors from VS Code)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 55d5513 into rust-lang:master Jan 31, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 31, 2022
@compiler-errors compiler-errors deleted the gat-expr-lifetime-elision branch April 7, 2022 04:34
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lifetime inference fails when construct then returning an instance of a GAT
6 participants