Skip to content

Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses. - #123122

Merged
bors merged 1 commit into
rust-lang:masterfrom
surechen:fix_122714
May 21, 2024
Merged

Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.#123122
bors merged 1 commit into
rust-lang:masterfrom
surechen:fix_122714

Conversation

@surechen

Copy link
Copy Markdown
Contributor

For poly-trait-ref like for<'a> Trait<T> in T: for<'a> Trait<T> + 'b { }.
We should merge the hrtb lifetimes: existed for<'a> and suggestion for<'b> or will get err: [E0316] nested quantification of lifetimes

fixes#122714

@rustbot

Copy link
Copy Markdown
Collaborator

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbotrustbot 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 Mar 27, 2024
Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
@surechen
surechenforce-pushed the fix_122714 branch 2 times, most recently from 2941db4 to db9b023CompareMarch 28, 2024 07:22
@surechen
surechen requested a review from fmeaseMarch 28, 2024 11:41
@fmeasefmease assigned fmease and unassigned oli-obkApr 7, 2024
Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
@fmeasefmease assigned oli-obk and unassigned fmeaseApr 8, 2024
@surechen
surechen requested a review from oli-obkApril 9, 2024 10:57
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
@oli-obk

Copy link
Copy Markdown
Contributor

r? @fmease

@rustbotrustbot assigned fmease and unassigned oli-obkApr 9, 2024
@surechen
surechen requested a review from fmeaseApril 10, 2024 01:22

@fmeasefmease left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apologies for the delay! I've potentially found some smaller issues. Furthermore, I'm not super convinced by the current approach which adds an entirely new field to the resolver just to fix a niche diagnostic bug. I go into more detail in some of my review comments.

Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_resolve/src/late.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs
@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2024
@surechen

Copy link
Copy Markdown
ContributorAuthor

Apologies for the delay! I've potentially found some smaller issues. Furthermore, I'm not super convinced by the current approach which adds an entirely new field to the resolver just to fix a niche diagnostic bug. I go into more detail in some of my review comments.

Thank you very much. Your review is very detailed and helps me a lot. I will spend some time processing it.

@rust-log-analyzer

This comment has been minimized.

@surechen
surechen requested a review from fmeaseApril 29, 2024 01:09
@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2024

@fmeasefmease left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot, that looks great! ❤️ I apologize for taking so long (yet again!) 😞.

Almost ready, I have a couple of small suggestions. Then I will put into the merge queue!

Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
Comment threadcompiler/rustc_resolve/src/late/diagnostics.rs Outdated
@fmeasefmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2024
@surechen
surechen requested a review from fmeaseMay 21, 2024 01:22
@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 21, 2024
@surechen

Copy link
Copy Markdown
ContributorAuthor

Thanks a lot, that looks great! ❤️ I apologize for taking so long (yet again!) 😞.

Almost ready, I have a couple of small suggestions. Then I will put into the merge queue!

Thank you very much. Please help me review again.

@fmeasefmease left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot!

@fmease

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented May 21, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 4ebbb5f has been approved by fmease

It is now in the queue for this repository.

@borsbors 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 May 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 21, 2024
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.
For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`.
We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes
fixesrust-lang#122714
fmease added a commit to fmease/rust that referenced this pull request May 21, 2024
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.
For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`.
We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes
fixesrust-lang#122714
@fmeasefmease mentioned this pull request May 21, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 21, 2024
…iaskrgr
Rollup of 6 pull requests
Successful merges:
- rust-lang#122665 (Add some tests for public-private dependencies.)
- rust-lang#123122 (Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.)
- rust-lang#125276 (Fix parsing of erroneously placed semicolons)
- rust-lang#125310 (Move ~100 tests from tests/ui to subdirs)
- rust-lang#125357 (Migrate `run-make/rustdoc-scrape-examples-multiple` to `rmake.rs`)
- rust-lang#125369 (Don't do cc detection for synthetic targets)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 21, 2024
…iaskrgr
Rollup of 6 pull requests
Successful merges:
- rust-lang#123122 (Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.)
- rust-lang#123492 (add pull request template asking for relevant tracking issues)
- rust-lang#125276 (Fix parsing of erroneously placed semicolons)
- rust-lang#125310 (Move ~100 tests from tests/ui to subdirs)
- rust-lang#125357 (Migrate `run-make/rustdoc-scrape-examples-multiple` to `rmake.rs`)
- rust-lang#125369 (Don't do cc detection for synthetic targets)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 6009cb7 into rust-lang:masterMay 21, 2024
@rustbotrustbot added this to the 1.80.0 milestone May 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 21, 2024
Rollup merge of rust-lang#123122 - surechen:fix_122714, r=fmease
Fix incorrect suggestion for undeclared hrtb lifetimes in where clauses.
For poly-trait-ref like `for<'a> Trait<T>` in `T: for<'a> Trait<T> + 'b { }`.
We should merge the hrtb lifetimes: existed `for<'a>` and suggestion `for<'b>` or will get err: [E0316] nested quantification of lifetimes
fixesrust-lang#122714
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

6 participants

@surechen@rustbot@oli-obk@rust-log-analyzer@fmease@bors