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

Fix SelfVisitor::is_self_ty ICE #103221

Merged
merged 2 commits into from
Oct 20, 2022
Merged

Fix SelfVisitor::is_self_ty ICE #103221

merged 2 commits into from
Oct 20, 2022

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Oct 19, 2022

Fixes #103202

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 19, 2022
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2022
struct S {}

impl S {
fn f(self: &S::x) {} //~ ERROR ambiguous associated type
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm.. that error seems incorrect. Maybe we should bubble out a new ResolutionError variant from find_lifetime_for_self by changing the lifetime field of the visitor to a Result that, once set to Err simply doesn't do anything else anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

The error does not come from find_lifetime_forself, it looks like the regular error because S` is known to be a type and we expect a type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Before this regression, rustc caused the following error:

error[E0223]: ambiguous associated type
 --> src/main.rs:4:17
  |
4 |     fn f(self: &S::x) {} //~ ERROR ambiguous associated type
  |                 ^^^^ help: use fully-qualified syntax: `<S as Trait>::x`

compiler/rustc_resolve/src/late.rs Outdated Show resolved Hide resolved
struct S {}

impl S {
fn f(self: &S::x) {} //~ ERROR ambiguous associated type
Copy link
Contributor

Choose a reason for hiding this comment

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

The error does not come from find_lifetime_forself, it looks like the regular error because S` is known to be a type and we expect a type.

@rustbot rustbot added the A-testsuite Area: The testsuite used to check the correctness of rustc label Oct 20, 2022
@TaKO8Ki TaKO8Ki requested review from oli-obk and cjgillot October 20, 2022 05:16
@oli-obk
Copy link
Contributor

oli-obk commented Oct 20, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 20, 2022

📌 Commit 9a9e2fe has been approved by oli-obk

It is now in the queue for this repository.

@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 Oct 20, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 20, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 20, 2022
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#103221 (Fix `SelfVisitor::is_self_ty` ICE)
 - rust-lang#103230 (Clarify startup)
 - rust-lang#103281 (Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output)
 - rust-lang#103288 (Fixed docs typo in `library/std/src/time.rs`)
 - rust-lang#103296 (+/- shortcut now only expand/collapse, not both)
 - rust-lang#103297 (fix typo)
 - rust-lang#103313 (Don't label `src/test` tests as `A-testsuite`)
 - rust-lang#103315 (interpret: remove an incorrect assertion)
 - rust-lang#103319 (Improve "`~const` is not allowed here" message)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7ee4b21 into rust-lang:master Oct 20, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 20, 2022
@TaKO8Ki TaKO8Ki deleted the fix-103202 branch October 21, 2022 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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.

ICE: panicked at 'unexpected unresolved segments'
6 participants